Home > OS >  devspace enter command is just returning [fatal] unknown flag: --omit
devspace enter command is just returning [fatal] unknown flag: --omit

Time:10-03

I'm making a command to run tests inside of a container on demand that looks like this:

- name: api-test
  description: Runs API tests in container
  command: |
    devspace enter --image-selector ${APP-NAME}/${API-DEV} \
      coverage run --omit='src/manage.py,src/config/*,*/.venv/*,*/*__init__.py,*/tests.py,*/admin.py' src/manage.py test src && \
      coverage report

When I run devspace run api-test I get:

[fatal]  unknown flag: --omit

I also get the same error just copying the command into my CLI, so it is more of a bash issue than devspace.

I don't have coverage locally which is why I'm trying to just run it in the container, but it seems like how I currently have it configured it is trying to run it locally. That being said I don't have Django locally either in a container and something like the following runs fine:

devspace enter --image-selector ${APP-NAME}/${API-DEV} ./manage.py show migrations

I'm thinking there is some way I can write this command that will address the error. Any suggestions?

CodePudding user response:

Try devspace enter --image-selector ${APP-NAME}/${API-DEV} -- bash -c "YOUR_BASH_COMMANDS_HERE"

-- makes sure that all flags afterwards are not meant to be flags for devspace enter and bash -c STRING starts a shell and passes the STRING as commands to be run in this shell.

  • Related