mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 15:05:27 +00:00
Merge pull request #38354 from bruceauyeung/k8s-branch-blank-validate-on-env-params
Automatic merge from submit-queue trimspace on user specified env params **What this PR does / why we need it**: before this PR, for example, if user `export KUBE_REPO_PREFIX=" "`, kubeadm will get an absolutely invalid repo_prefix. this PR trims all leading and trailing white spaces from user specified env params. Signed-off-by: bruceauyeung <ouyang.qinhua@zte.com.cn>
This commit is contained in:
commit
3a85ad9514
@ -43,7 +43,7 @@ func SetEnvParams() *EnvParams {
|
||||
}
|
||||
|
||||
for k := range envParams {
|
||||
if v := os.Getenv(fmt.Sprintf("KUBE_%s", strings.ToUpper(k))); v != "" {
|
||||
if v := strings.TrimSpace(os.Getenv(fmt.Sprintf("KUBE_%s", strings.ToUpper(k)))); v != "" {
|
||||
envParams[k] = v
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user