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:
Kubernetes Submit Queue 2016-12-09 03:43:16 -08:00 committed by GitHub
commit 3a85ad9514

View File

@ -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
}
}