From e33d4678e608f9b68d33d0190d034833ccef19cb Mon Sep 17 00:00:00 2001 From: Filipe Brandenburger Date: Wed, 27 Aug 2014 19:00:41 -0700 Subject: [PATCH] Fix `line 55: ldflags[*]: unbound variable` This is caused by bash thinking that an empty array is the same as an undefined variable and `set -o nounset` treating that as an error. Fix that by using an empty string as the default for the expansion. Fixes PR #1069 (6e25f602882196d22340a31fb05b24384e907d71). Tested: - Before this patch: $ mv .git .gitbackup $ hack/build-go.sh /home/filbranden/devel/kubernetes/hack/config-go.sh: line 55: ldflags[*]: unbound variable - After this patch: $ mv .git .gitbackup $ rm -rf output/ $ hack/build-go.sh $ output/go/bin/kubelet -version Kubernetes version 0.1+, build (unknown) Signed-off-by: Filipe Brandenburger --- hack/config-go.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/config-go.sh b/hack/config-go.sh index 6bb6037c681..52d04d1d857 100644 --- a/hack/config-go.sh +++ b/hack/config-go.sh @@ -52,7 +52,7 @@ kube::version_ldflags() { fi # The -ldflags parameter takes a single string, so join the output. - echo "${ldflags[*]}" + echo "${ldflags[*]-}" ) }