Merge pull request #57222 from xialonglee/keep-ldfalgs-spaces-safe

Automatic merge from submit-queue (batch tested with PRs 55475, 57155, 57260, 57222). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

make sure that 'ldflags' are space-safe

**What this PR does / why we need it**:
Recently I met the problem as #56216 described, I download the source-tar of 1.8.5 and run `make` command failed because of invalid ldflag: 
 `-X k8s.io/kubernetes/pkg/version.gitTreeState=git archive`

Though #56249 has change version string `git archive` to `archive`, i think we should avoid this problem happen again.

cc @ixdy 

**Release note**: NONE
pull/6/head
Kubernetes Submit Queue 2017-12-18 19:45:46 -08:00 committed by GitHub
commit cdbfff0773
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -133,8 +133,8 @@ kube::version::ldflag() {
local val=${2}
# If you update these, also update the list pkg/version/def.bzl.
echo "-X ${KUBE_GO_PACKAGE}/pkg/version.${key}=${val}"
echo "-X ${KUBE_GO_PACKAGE}/vendor/k8s.io/client-go/pkg/version.${key}=${val}"
echo "-X '${KUBE_GO_PACKAGE}/pkg/version.${key}=${val}'"
echo "-X '${KUBE_GO_PACKAGE}/vendor/k8s.io/client-go/pkg/version.${key}=${val}'"
}
# Prints the value that needs to be passed to the -ldflags parameter of go build