Skip to content

Conversation

@BenTheElder
Copy link
Member

@BenTheElder BenTheElder commented Dec 12, 2025

What type of PR is this?

/kind bug

What this PR does / why we need it:

Ensures podresize tests work when the test binary is compiled for non-linux platforms (the pods created by the test will still be for linux in the cluster under test, but the test itself can be on mac/windows)

Follow up https://github.com/kubernetes/kubernetes/pull/132791/changes#r2615407057

We can see the one utility used from opencontainers/cgroups is portable: https://github.com/opencontainers/cgroups/blob/e0c56cb31dcb3cb2b3d1554b20dd01ced32e2a2b/utils.go#L425

Which issue(s) this PR is related to:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

ensure pod-resize tests compile correctly for non-linux platforms

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/bug Categorizes issue or PR as related to a bug. labels Dec 12, 2025
@k8s-ci-robot
Copy link
Contributor

Please note that we're already in Code Freeze for the upcoming v1.35.0 release.

Adding the milestone to this PR is strictly prohibited without proper approval. If this PR needs to be included in the v1.35.0 release:

  1. Technical review: get the PR reviewed and approved as usual (/lgtm and /approve)
  2. Inclusion in release: ping @sig-release-leads on the #sig-release Slack channel and suggest to add the v1.35.0 milestone to the PR

We're also in Test Freeze for the release-1.35 branch. This means every merged PR will be automatically fast-forwarded via the periodic ci-fast-forward job to the release branch of the upcoming v1.35.0 release.

Fast forwards are scheduled to happen every 6 hours, whereas the most recent run was: Fri Dec 12 15:42:09 UTC 2025.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. sig/node Categorizes an issue or PR as relevant to SIG Node. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. sig/testing Categorizes an issue or PR as relevant to SIG Testing. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 12, 2025
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Dec 12, 2025
@BenTheElder
Copy link
Member Author

/test pull-kubernetes-cross

// container runtimes, we check if either the old or the new conversion matches the actual value for now.
// TODO: Remove the old conversion once container runtimes are updated.
oldConverted := 1 + ((shares-2)*9999)/262142
converted := libcontainercgroups.ConvertCPUSharesToCgroupV2Value(uint64(shares))
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh, this utility is portable, but the package it is contained in is not.

We'll need to split out this code.
/hold

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 12, 2025
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 12, 2025
@BenTheElder BenTheElder changed the title compile computing cgroups correctly on all platforms ensure cgroups conversion computation in e2e tests builds for all platforms Dec 12, 2025
@BenTheElder
Copy link
Member Author

/hold

I think inlining the simple conversion computation makes more sense, but we might need to do the whole third_party thing, I'm not sure where the line is ... it's fairly straightforward math but ...

cc @kubernetes/dep-approvers

}
}

// this matches opencontainers/cgroups.ConvertCPUSharesToCgroupV2Value
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure at what point we need to jump through more hoops to do this, if it were just clamping to some well known values I think we'd just reimplement it ... not sure for this one @kubernetes/dep-approvers

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explicit
/hold
again
in fact let me mark this WIP

@BenTheElder BenTheElder force-pushed the cgroups-all branch 2 times, most recently from c8a8f69 to 5070bed Compare December 12, 2025 21:49
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Dec 12, 2025

@BenTheElder: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-kubernetes-cross 944f49c link false /test pull-kubernetes-cross

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

allows us to trivially support all platforms for the test binary

this conversion ideally needs to be stable anyhow to avoid test incompatibility ...

opencontainers/cgroups#18
kubernetes#135214
@BenTheElder BenTheElder changed the title ensure cgroups conversion computation in e2e tests builds for all platforms WIP: ensure cgroups conversion computation in e2e tests builds for all platforms Dec 12, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Dec 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/bug Categorizes issue or PR as related to a bug. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Development

Successfully merging this pull request may close these issues.

2 participants