update dependencies (#6267)
Signed-off-by: hongming <coder.scala@gmail.com>
This commit is contained in:
14
vendor/helm.sh/helm/v3/pkg/cli/environment.go
vendored
14
vendor/helm.sh/helm/v3/pkg/cli/environment.go
vendored
@@ -44,7 +44,7 @@ const defaultMaxHistory = 10
|
||||
// defaultBurstLimit sets the default client-side throttling limit
|
||||
const defaultBurstLimit = 100
|
||||
|
||||
// defaultQPS sets the default QPS value to 0 to to use library defaults unless specified
|
||||
// defaultQPS sets the default QPS value to 0 to use library defaults unless specified
|
||||
const defaultQPS = float32(0)
|
||||
|
||||
// EnvSettings describes all of the environment settings.
|
||||
@@ -112,7 +112,7 @@ func New() *EnvSettings {
|
||||
env.Debug, _ = strconv.ParseBool(os.Getenv("HELM_DEBUG"))
|
||||
|
||||
// bind to kubernetes config flags
|
||||
env.config = &genericclioptions.ConfigFlags{
|
||||
config := &genericclioptions.ConfigFlags{
|
||||
Namespace: &env.namespace,
|
||||
Context: &env.KubeContext,
|
||||
BearerToken: &env.KubeToken,
|
||||
@@ -133,6 +133,11 @@ func New() *EnvSettings {
|
||||
return config
|
||||
},
|
||||
}
|
||||
if env.BurstLimit != defaultBurstLimit {
|
||||
config = config.WithDiscoveryBurst(env.BurstLimit)
|
||||
}
|
||||
env.config = config
|
||||
|
||||
return env
|
||||
}
|
||||
|
||||
@@ -151,7 +156,7 @@ func (s *EnvSettings) AddFlags(fs *pflag.FlagSet) {
|
||||
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.RepositoryConfig, "repository-config", s.RepositoryConfig, "path to the file containing repository names and URLs")
|
||||
fs.StringVar(&s.RepositoryCache, "repository-cache", s.RepositoryCache, "path to the file containing cached repository indexes")
|
||||
fs.StringVar(&s.RepositoryCache, "repository-cache", s.RepositoryCache, "path to the directory containing cached repository indexes")
|
||||
fs.IntVar(&s.BurstLimit, "burst-limit", s.BurstLimit, "client-side default throttling limit")
|
||||
fs.Float32Var(&s.QPS, "qps", s.QPS, "queries per second used when communicating with the Kubernetes API, not including bursting")
|
||||
}
|
||||
@@ -244,6 +249,9 @@ func (s *EnvSettings) Namespace() string {
|
||||
if ns, _, err := s.config.ToRawKubeConfigLoader().Namespace(); err == nil {
|
||||
return ns
|
||||
}
|
||||
if s.namespace != "" {
|
||||
return s.namespace
|
||||
}
|
||||
return "default"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user