Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ko run fails when there is a ko flag #5

Closed
paivagustavo opened this issue Jan 14, 2019 · 0 comments · Fixed by #76
Closed

ko run fails when there is a ko flag #5

paivagustavo opened this issue Jan 14, 2019 · 0 comments · Fixed by #76

Comments

@paivagustavo
Copy link

Since the ko run forwards every argument starting from the second argument to the kubectl run command, if there is a ko flag like --preserve-import-paths this will be forwarded to the kubectl run.

The command ./ko run test --preserve-import-paths --image=./test/ results in the following error:

....
Usage:
  kubectl run NAME --image=image [--env="key=value"] [--port=port] [--replicas=replicas] [--dry-run=bool] [--overrides=inline-json] [--command] -- [COMMAND] [args...] [options]

Use "kubectl options" for a list of global command-line options (applies to all commands).

unknown flag: --preserve-import-paths
2019/01/14 21:15:08 error executing "kubectl run": exit status 1

Suggestion:

I think we should do something similar to the docker run command, where any flag passed before the run is considered a flag of the docker run and flags passed after the run are flags of the container to be executed.

@paivagustavo paivagustavo changed the title ko run fails when there is a ko's flag ko run fails when there is a ko flag Jan 14, 2019
@jonjohnsonjr jonjohnsonjr transferred this issue from google/go-containerregistry Mar 21, 2019
karthikraobr pushed a commit to karthikraobr/ko that referenced this issue Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant