|
|
|
@ -95,6 +95,7 @@ func addRootFlags(cmd *cobra.Command) {
|
|
|
|
|
pf.StringVar((*string)(&settings.Home), "home", helm_env.DefaultHelmHome, "location of your Helm config. Overrides $HELM_HOME")
|
|
|
|
|
pf.StringVar(&settings.TillerHost, "host", "", "address of tiller. Overrides $HELM_HOST")
|
|
|
|
|
pf.StringVar(&kubeContext, "kube-context", "", "name of the kubeconfig context to use")
|
|
|
|
|
pf.StringVar(&settings.Kubeconfig, "kubeconfig", "", "path to kubeconfig file")
|
|
|
|
|
pf.BoolVar(&settings.Debug, "debug", false, "enable verbose output")
|
|
|
|
|
pf.StringVar(&settings.TillerNamespace, "tiller-namespace", tiller_env.DefaultTillerNamespace, "namespace of tiller")
|
|
|
|
|
}
|
|
|
|
@ -102,6 +103,7 @@ func addRootFlags(cmd *cobra.Command) {
|
|
|
|
|
func initRootFlags(cmd *cobra.Command) {
|
|
|
|
|
setFlagsFromEnv(map[string]string{
|
|
|
|
|
"debug": helm_env.DebugEnvVar,
|
|
|
|
|
"kubeconfig": helm_env.KubeconfigEnvVar,
|
|
|
|
|
"home": helm_env.HomeEnvVar,
|
|
|
|
|
"host": helm_env.HostEnvVar,
|
|
|
|
|
"tiller-namespace": tiller_env.TillerNamespaceEnvVar,
|
|
|
|
@ -244,7 +246,7 @@ func prettyError(err error) error {
|
|
|
|
|
|
|
|
|
|
// configForContext creates a Kubernetes REST client configuration for a given kubeconfig context.
|
|
|
|
|
func configForContext(context string) (*rest.Config, error) {
|
|
|
|
|
config, err := kube.GetConfig(context).ClientConfig()
|
|
|
|
|
config, err := kube.GetConfig(context, settings.Kubeconfig).ClientConfig()
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, fmt.Errorf("could not get Kubernetes config for context %q: %s", context, err)
|
|
|
|
|
}
|
|
|
|
|