diff --git a/hack/lib/golang.sh b/hack/lib/golang.sh index 596196b13252b..8ad24b98a342d 100755 --- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -356,7 +356,9 @@ kube::golang::is_statically_linked_library() { if [[ -n "${KUBE_CGO_OVERRIDES_LIST:+x}" ]]; then for e in "${KUBE_CGO_OVERRIDES_LIST[@]}"; do [[ "${1}" == *"/${e}" ]] && return 1; done; fi - for e in "${KUBE_STATIC_LIBRARIES[@]}"; do [[ "${1}" == *"/${e}" ]] && return 0; done; + if [[ -n "${KUBE_STATIC_LIBRARIES:+x}" ]]; then + for e in "${KUBE_STATIC_LIBRARIES[@]}"; do [[ "${1}" == *"/${e}" ]] && return 0; done; + fi if [[ -n "${KUBE_STATIC_OVERRIDES_LIST:+x}" ]]; then for e in "${KUBE_STATIC_OVERRIDES_LIST[@]}"; do [[ "${1}" == *"/${e}" ]] && return 0; done; fi