Skip to content

v3: Propagate --kube-context, --kubeconfig and --namespace values to plugins - #6632

Merged
bacongobbler merged 1 commit into
helm:dev-v3from
mumoshu:add-plugin-envvars
Oct 11, 2019
Merged

bacongobbler merged 1 commit into
helm:dev-v3from
mumoshu:add-plugin-envvars

Conversation

@mumoshu

@mumoshu mumoshu commented Oct 10, 2019

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Closes #6631

Special notes for your reviewer:

If applicable:

  • this PR contains documentation
  • this PR contains unit tests
  • this PR has been tested for backwards compatibility

@helm-bot helm-bot added the size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Oct 10, 2019
@bacongobbler bacongobbler added feature v3.x Issues and Pull Requests related to the major version v3 labels Oct 10, 2019
Comment thread pkg/cli/environment.go
"HELM_REGISTRY_CONFIG": s.RegistryConfig,
"HELM_REPOSITORY_CACHE": s.RepositoryCache,
"HELM_REPOSITORY_CONFIG": s.RepositoryConfig,
"HELM_NAMESPACE": s.Namespace,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name HELM_NAMESPACE is borrowed form an another PR from @adamreese https://github.com/helm/helm/pull/6508/files#r330893957

Other two are named such so that they become consistent with all the other envvars.

Comment thread pkg/cli/environment.go Outdated
"HELM_REPOSITORY_CONFIG": s.RepositoryConfig,
"HELM_NAMESPACE": s.Namespace,
"HELM_KUBECONTEXT": s.KubeContext,
"HELM_KUBECONFIG": s.KubeConfig,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about exposing this as KUBECONFIG for plugins? That way invocations ofhelm (or kubectl) from a plug-in would automatically pick in the correct config. This would have to be conditional so that if —kubeconfig is not set we don‘t clobber a value set in the KUBECONFIG env var

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@databus23 Sounds good! Addressed in the last commit.

@mumoshu
mumoshu force-pushed the add-plugin-envvars branch from da351de to 69adc5a Compare October 11, 2019 12:06
@helm-bot helm-bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 11, 2019
@bacongobbler bacongobbler added this to the 3.0.0-beta.5 milestone Oct 11, 2019
@bacongobbler
bacongobbler merged commit ed90425 into helm:dev-v3 Oct 11, 2019
@mumoshu
mumoshu deleted the add-plugin-envvars branch October 12, 2019 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature size/S Denotes a PR that changes 10-29 lines, ignoring generated files. v3.x Issues and Pull Requests related to the major version v3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants