ko icon indicating copy to clipboard operation
ko copied to clipboard

run: allow passing arbitrary flags after `--`

Open Dentrax opened this issue 2 years ago • 6 comments

It would be nice to add --namespace flag for run subcommand as in apply command. But noticed a (DEPRECATED) warning. So couldn't get the actual reason why --namespace is deprecated. We moved it to an env var or something different way?

Workaround is to switch namespace using kubectl $ kubectl config set-context foo then ko run .

ko: 0.11.2

cc @developer-guy

Dentrax avatar Jul 06 '22 12:07 Dentrax

I don't think ko run is very widely used -- I don't think I've ever used it myself -- but it does seem like --namespace would be a useful addition, if we decide to keep the command around.

ko run ./cmd/app -n foo -- arg1 arg2 sgtm

imjasonh avatar Jul 06 '22 13:07 imjasonh

As for why ko apply --namespace is (DEPRECATED), that's because we want to have users just pass flags directly through to kubectl instead of having them be flags on ko apply itself. See https://github.com/google/ko/issues/317 -- we log a deprecation warning for that, but should probably just go ahead and clean up the old flags by now.

imjasonh avatar Jul 06 '22 13:07 imjasonh

We've decided to keep ko run around at least for now, so if you or anyone reading this is interested in adding it, that could be nice.

I'd probably want to support passing flags arbitrary to kubectl run similar to how we do it for ko apply today, by passing anything after -- to kubectl run directly. This would enable --namespace/-n, and also other nice things like --attach.

imjasonh avatar Aug 24 '22 13:08 imjasonh

This issue is stale because it has been open for 90 days with no activity. It will automatically close after 30 more days of inactivity. Keep fresh with the 'lifecycle/frozen' label.

github-actions[bot] avatar Nov 23 '22 01:11 github-actions[bot]

kindly ping @Dentrax, are you going to implement this?

developer-guy avatar Jan 11 '23 12:01 developer-guy

If ko keep continuing to support run command, then we can start to work on this. Updated the issue title.

Dentrax avatar Jan 11 '23 12:01 Dentrax