@ -54,6 +54,8 @@ type EnvSettings struct {
KubeAsGroups [ ] string
KubeAsGroups [ ] string
// Kubernetes API Server Endpoint for authentication
// Kubernetes API Server Endpoint for authentication
KubeAPIServer string
KubeAPIServer string
// Custom certificate authority file.
KubeCaFile string
// Debug indicates whether or not Helm is running in Debug mode.
// Debug indicates whether or not Helm is running in Debug mode.
Debug bool
Debug bool
// RegistryConfig is the path to the registry config file.
// RegistryConfig is the path to the registry config file.
@ -77,6 +79,7 @@ func New() *EnvSettings {
KubeAsUser : os . Getenv ( "HELM_KUBEASUSER" ) ,
KubeAsUser : os . Getenv ( "HELM_KUBEASUSER" ) ,
KubeAsGroups : envCSV ( "HELM_KUBEASGROUPS" ) ,
KubeAsGroups : envCSV ( "HELM_KUBEASGROUPS" ) ,
KubeAPIServer : os . Getenv ( "HELM_KUBEAPISERVER" ) ,
KubeAPIServer : os . Getenv ( "HELM_KUBEAPISERVER" ) ,
KubeCaFile : os . Getenv ( "HELM_KUBECAFILE" ) ,
PluginsDirectory : envOr ( "HELM_PLUGINS" , helmpath . DataPath ( "plugins" ) ) ,
PluginsDirectory : envOr ( "HELM_PLUGINS" , helmpath . DataPath ( "plugins" ) ) ,
RegistryConfig : envOr ( "HELM_REGISTRY_CONFIG" , helmpath . ConfigPath ( "registry.json" ) ) ,
RegistryConfig : envOr ( "HELM_REGISTRY_CONFIG" , helmpath . ConfigPath ( "registry.json" ) ) ,
RepositoryConfig : envOr ( "HELM_REPOSITORY_CONFIG" , helmpath . ConfigPath ( "repositories.yaml" ) ) ,
RepositoryConfig : envOr ( "HELM_REPOSITORY_CONFIG" , helmpath . ConfigPath ( "repositories.yaml" ) ) ,
@ -90,6 +93,7 @@ func New() *EnvSettings {
Context : & env . KubeContext ,
Context : & env . KubeContext ,
BearerToken : & env . KubeToken ,
BearerToken : & env . KubeToken ,
APIServer : & env . KubeAPIServer ,
APIServer : & env . KubeAPIServer ,
CAFile : & env . KubeCaFile ,
KubeConfig : & env . KubeConfig ,
KubeConfig : & env . KubeConfig ,
Impersonate : & env . KubeAsUser ,
Impersonate : & env . KubeAsUser ,
ImpersonateGroup : & env . KubeAsGroups ,
ImpersonateGroup : & env . KubeAsGroups ,
@ -106,6 +110,7 @@ func (s *EnvSettings) AddFlags(fs *pflag.FlagSet) {
fs . StringVar ( & s . KubeAsUser , "kube-as-user" , s . KubeAsUser , "username to impersonate for the operation" )
fs . StringVar ( & s . KubeAsUser , "kube-as-user" , s . KubeAsUser , "username to impersonate for the operation" )
fs . StringArrayVar ( & s . KubeAsGroups , "kube-as-group" , s . KubeAsGroups , "group to impersonate for the operation, this flag can be repeated to specify multiple groups." )
fs . StringArrayVar ( & s . KubeAsGroups , "kube-as-group" , s . KubeAsGroups , "group to impersonate for the operation, this flag can be repeated to specify multiple groups." )
fs . StringVar ( & s . KubeAPIServer , "kube-apiserver" , s . KubeAPIServer , "the address and the port for the Kubernetes API server" )
fs . StringVar ( & s . KubeAPIServer , "kube-apiserver" , s . KubeAPIServer , "the address and the port for the Kubernetes API server" )
fs . StringVar ( & s . KubeCaFile , "kube-ca-file" , s . KubeCaFile , "the certificate authority file for the Kubernetes API server connection" )
fs . BoolVar ( & s . Debug , "debug" , s . Debug , "enable verbose output" )
fs . BoolVar ( & s . Debug , "debug" , s . Debug , "enable verbose output" )
fs . StringVar ( & s . RegistryConfig , "registry-config" , s . RegistryConfig , "path to the registry config file" )
fs . StringVar ( & s . RegistryConfig , "registry-config" , s . RegistryConfig , "path to the registry config file" )
fs . StringVar ( & s . RepositoryConfig , "repository-config" , s . RepositoryConfig , "path to the file containing repository names and URLs" )
fs . StringVar ( & s . RepositoryConfig , "repository-config" , s . RepositoryConfig , "path to the file containing repository names and URLs" )
@ -159,6 +164,7 @@ func (s *EnvSettings) EnvVars() map[string]string {
"HELM_KUBEASUSER" : s . KubeAsUser ,
"HELM_KUBEASUSER" : s . KubeAsUser ,
"HELM_KUBEASGROUPS" : strings . Join ( s . KubeAsGroups , "," ) ,
"HELM_KUBEASGROUPS" : strings . Join ( s . KubeAsGroups , "," ) ,
"HELM_KUBEAPISERVER" : s . KubeAPIServer ,
"HELM_KUBEAPISERVER" : s . KubeAPIServer ,
"HELM_KUBECAFILE" : s . KubeCaFile ,
}
}
if s . KubeConfig != "" {
if s . KubeConfig != "" {
envvars [ "KUBECONFIG" ] = s . KubeConfig
envvars [ "KUBECONFIG" ] = s . KubeConfig