Unverified Commit 0d9e247a authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #54071 from HubSpot/kube-build-parent-cgroup

Automatic merge from submit-queue (batch tested with PRs 54071, 58393). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Optionally launch build containers inside a specific parent cgroup **What this PR does / why we need it**: Adds support to the build process for launching containers inside a specific parent cgroup via the `--cgroup-parent` docker arg. We needed this to enforce resource usage when building Kubernetes in our CI environment. **Special notes for your reviewer**: None **Release note**: ```release-note NONE ```
parents cdf26b05 4ec6e128
...@@ -601,6 +601,11 @@ function kube::build::run_build_command_ex() { ...@@ -601,6 +601,11 @@ function kube::build::run_build_command_ex() {
--env "GOGCFLAGS=${GOGCFLAGS:-}" --env "GOGCFLAGS=${GOGCFLAGS:-}"
) )
if [[ -n "${DOCKER_CGROUP_PARENT:-}" ]]; then
kube::log::status "Using ${DOCKER_CGROUP_PARENT} as container cgroup parent"
docker_run_opts+=(--cgroup-parent "${DOCKER_CGROUP_PARENT}")
fi
# If we have stdin we can run interactive. This allows things like 'shell.sh' # If we have stdin we can run interactive. This allows things like 'shell.sh'
# to work. However, if we run this way and don't have stdin, then it ends up # to work. However, if we run this way and don't have stdin, then it ends up
# running in a daemon-ish mode. So if we don't have a stdin, we explicitly # running in a daemon-ish mode. So if we don't have a stdin, we explicitly
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment