Skip to content

Conversation

@tyrantkhan
Copy link

@tyrantkhan tyrantkhan commented Dec 7, 2025

Fixes #799

Checklist
[X] Documentation is changed or added (if applicable)

Description of change

Adds GOSS_KUBECTL_RUN_OPTS environment variable for options that should only be passed to kubectl run, not to other kubectl commands like wait, cp, exec, or delete.

This is needed because --overrides is only valid for kubectl run, but GOSS_KUBECTL_OPTS is passed to all kubectl commands, causing errors like:

error: unknown flag: --overrides
See 'kubectl wait --help' for usage.

Common use cases:

  • Setting serviceAccountName for imagePullSecrets (private registries)
  • Setting nodeSelector for architecture-specific scheduling
  • Setting tolerations for tainted nodes

Example:

GOSS_KUBECTL_RUN_OPTS='--overrides={"spec":{"serviceAccountName":"my-sa"}}' kgoss run -i myimage:tag

📚 Documentation preview 📚: https://goss--1044.org.readthedocs.build/en/1044/

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 this pull request may close these issues.

GOSS_KUBECTL_OPTS not working with some kubectl args

1 participant