From b6fbe2aee585d078644f6337f84a348e743e209a Mon Sep 17 00:00:00 2001 From: Ismo Puustinen Date: Tue, 13 Feb 2018 13:02:06 +0200 Subject: [PATCH] hack/update-codegen.sh: split string into array robustly. Use "mapfile" and "read" to split the $KUBE_AVAILABLE_GROUP_VERSIONS string into an array using space as the delimiter. This prevents shell from globbing and splitting the string in potentially wrong places. --- hack/update-codegen.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hack/update-codegen.sh b/hack/update-codegen.sh index 9c29807b438..bd4b93d4b7c 100755 --- a/hack/update-codegen.sh +++ b/hack/update-codegen.sh @@ -38,7 +38,7 @@ informergen=$(kube::util::find-binary "informer-gen") # that generates the set-gen program. # -GROUP_VERSIONS=(${KUBE_AVAILABLE_GROUP_VERSIONS}) +IFS=" " read -ra GROUP_VERSIONS <<< "$KUBE_AVAILABLE_GROUP_VERSIONS" GV_DIRS=() INTERNAL_DIRS=() for gv in "${GROUP_VERSIONS[@]}"; do