// addFlagsTLS adds the flags for supporting client side TLS to the
// helm command (only those that invoke communicate to Tiller.)
funcaddFlagsTLS(cmd*cobra.Command)*cobra.Command{
// add flags
cmd.Flags().StringVar(&tlsServerName,"tls-hostname",settings.TillerHost,"the server name used to verify the hostname on the returned certificates from the server")
cmd.Flags().StringVar(&tlsCaCertFile,"tls-ca-cert",tlsCaCertDefault,"path to TLS CA certificate file")
cmd.Flags().StringVar(&tlsCertFile,"tls-cert",tlsCertDefault,"path to TLS certificate file")
cmd.Flags().StringVar(&tlsKeyFile,"tls-key",tlsKeyDefault,"path to TLS key file")
cmd.Flags().BoolVar(&tlsVerify,"tls-verify",false,"enable TLS for request and verify remote")
cmd.Flags().BoolVar(&tlsEnable,"tls",false,"enable TLS for request")
f.BoolVarP(&d.force,"force","f",false,"forces Tiller uninstall even if there are releases installed, or if Tiller is not in ready state. Releases are not deleted.)")
f.BoolVarP(&d.force,"force","f",false,"forces Tiller uninstall even if there are releases installed, or if Tiller is not in ready state. Releases are not deleted.)")
f.BoolVar(&d.removeHelmHome,"remove-helm-home",false,"if set deletes $HELM_HOME")
f.BoolVar(&d.removeHelmHome,"remove-helm-home",false,"if set deletes $HELM_HOME")
fs.StringVar(&s.TillerNamespace,"tiller-namespace","kube-system","namespace of Tiller")
fs.StringVar(&s.TillerNamespace,"tiller-namespace","kube-system","namespace of Tiller")
fs.Int64Var(&s.TillerConnectionTimeout,"tiller-connection-timeout",int64(300),"the duration (in seconds) Helm will wait to establish a connection to tiller")
fs.Int64Var(&s.TillerConnectionTimeout,"tiller-connection-timeout",int64(300),"the duration (in seconds) Helm will wait to establish a connection to tiller")
envMap:=map[string]string{
"debug":"HELM_DEBUG",
"home":"HELM_HOME",
"host":"HELM_HOST",
"tiller-namespace":"TILLER_NAMESPACE",
}
forname,envar:=rangeenvMap{
setFlagFromEnv(name,envar,fs)
}
}
}
// Init sets values from the environment.
// AddFlagsTLS adds the flags for supporting client side TLS to the given flagset.
func(s*EnvSettings)Init(fs*pflag.FlagSet){
func(s*EnvSettings)AddFlagsTLS(fs*pflag.FlagSet){
fs.StringVar(&s.TLSServerName,"tls-hostname",s.TillerHost,"the server name used to verify the hostname on the returned certificates from the server")
fs.StringVar(&s.TLSCaCertFile,"tls-ca-cert",DefaultTLSCaCert,"path to TLS CA certificate file")
fs.StringVar(&s.TLSCertFile,"tls-cert",DefaultTLSCert,"path to TLS certificate file")
fs.StringVar(&s.TLSKeyFile,"tls-key",DefaultTLSKeyFile,"path to TLS key file")
fs.BoolVar(&s.TLSVerify,"tls-verify",DefaultTLSVerify,"enable TLS for request and verify remote")
fs.BoolVar(&s.TLSEnable,"tls",DefaultTLSEnable,"enable TLS for request")
envMap:=map[string]string{
"tls-hostname":"HELM_TLS_HOSTNAME",
"tls-ca-cert":"HELM_TLS_CA_CERT",
"tls-cert":"HELM_TLS_CERT",
"tls-key":"HELM_TLS_KEY",
"tls-verify":"HELM_TLS_VERIFY",
"tls":"HELM_TLS_ENABLE",
}
forname,envar:=rangeenvMap{
forname,envar:=rangeenvMap{
setFlagFromEnv(name,envar,fs)
setFlagFromEnv(name,envar,fs)
}
}
}
}
// Init is deprecated; calling `.AddFlags` or `.AddFlagsTLS` directly will set the flags to their default values from the environment, so this is a no-op.
func(s*EnvSettings)Init(fs*pflag.FlagSet){}
// PluginDirs is the path to the plugin directories.
// PluginDirs is the path to the plugin directories.
func(sEnvSettings)PluginDirs()string{
func(sEnvSettings)PluginDirs()string{
ifd,ok:=os.LookupEnv("HELM_PLUGIN");ok{
ifd,ok:=os.LookupEnv("HELM_PLUGIN");ok{
@ -79,14 +134,6 @@ func (s EnvSettings) PluginDirs() string {