Skip to content

scenario -- --help is broken by new internal client structure #677

@pinheadmz

Description

@pinheadmz

The issue is that when we pass -- -- help to learn a scenario's options we actually run the scenario file locally. The problem with that is now we assume scenarios are only run inside the cluster, with access to the kubernetes internal client:

(.venv) --> warnet run scenarios/miner_std.py -- --help
Traceback (most recent call last):
  File "/Users/matthewzipkin/Desktop/work/battle-of-galen-erso/scenarios/miner_std.py", line 5, in <module>
    from commander import Commander
  File "/Users/matthewzipkin/Desktop/work/battle-of-galen-erso/scenarios/commander.py", line 29, in <module>
    with open("/var/run/secrets/kubernetes.io/serviceaccount/namespace") as f:
         ~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/run/secrets/kubernetes.io/serviceaccount/namespace'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions