mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
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 ```
This commit is contained in:
commit
0d9e247aaa
@ -601,6 +601,11 @@ function kube::build::run_build_command_ex() {
|
||||
--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'
|
||||
# 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
|
||||
|
Loading…
Reference in New Issue
Block a user