Allow override of CGO_ENABLED=0

When building inside a docker container, we fail to pass along enough
information for KUBE_CGO_OVERRIDES. The original PR was geared towards
building the binary from the command line

- dca376a03e
- e4ded2b3ec

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
This commit is contained in:
Davanum Srinivas
2021-08-05 10:44:16 -04:00
parent 2b06890e12
commit af2129b77d
2 changed files with 3 additions and 0 deletions

View File

@@ -716,6 +716,7 @@ kube::golang::build_binaries_for_platform() {
-ldflags "${goldflags:-}"
-tags "${gotags:-}"
)
V=1 kube::log::info "> static build CGO_ENABLED=0: ${statics[*]}"
CGO_ENABLED=0 kube::golang::build_some_binaries "${statics[@]}"
fi
@@ -728,6 +729,7 @@ kube::golang::build_binaries_for_platform() {
-buildmode pie
-tags "${gotags:-}"
)
V=1 kube::log::info "> non-static build: ${nonstatics[*]}"
kube::golang::build_some_binaries "${nonstatics[@]}"
fi