Merge pull request #111906 from tosi3k/apiserver-godebug

Add a possibility of setting GODEBUG env var for kube-apiserver binary
This commit is contained in:
Kubernetes Prow Robot 2022-08-23 20:08:45 -07:00 committed by GitHub
commit da558e44ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 0 deletions

View File

@ -343,6 +343,12 @@ function start-kube-apiserver {
fi
container_env+="{\"name\": \"KUBE_PATCH_CONVERSION_DETECTOR\", \"value\": \"${ENABLE_PATCH_CONVERSION_DETECTOR}\"}"
fi
if [[ -n "${KUBE_APISERVER_GODEBUG:-}" ]]; then
if [[ -n "${container_env}" ]]; then
container_env="${container_env}, "
fi
container_env+="{\"name\": \"GODEBUG\", \"value\": \"${KUBE_APISERVER_GODEBUG}\"}"
fi
if [[ -n "${container_env}" ]]; then
container_env="\"env\":[${container_env}],"
fi

View File

@ -1320,6 +1320,12 @@ EOF
if [ -n "${KUBE_APISERVER_REQUEST_TIMEOUT_SEC:-}" ]; then
cat >>"$file" <<EOF
KUBE_APISERVER_REQUEST_TIMEOUT_SEC: $(yaml-quote "${KUBE_APISERVER_REQUEST_TIMEOUT_SEC}")
EOF
fi
# KUBE_APISERVER_GODEBUG (if set) controls the value of GODEBUG env var for kube-apiserver.
if [ -n "${KUBE_APISERVER_GODEBUG:-}" ]; then
cat >>"$file" <<EOF
KUBE_APISERVER_GODEBUG: $(yaml-quote "${KUBE_APISERVER_GODEBUG}")
EOF
fi
# ETCD_IMAGE (if set) allows to use a custom etcd image.