Skip to content

Skip non-Windows pods in Hyper-V mutating webhook#561

Merged
k8s-ci-robot merged 1 commit into
kubernetes-sigs:masterfrom
rzlink:fix/webhook-skip-non-windows-pods
May 4, 2026
Merged

Skip non-Windows pods in Hyper-V mutating webhook#561
k8s-ci-robot merged 1 commit into
kubernetes-sigs:masterfrom
rzlink:fix/webhook-skip-non-windows-pods

Conversation

@rzlink

@rzlink rzlink commented May 4, 2026

Copy link
Copy Markdown
Contributor

What this PR does

Fixes the Hyper-V mutating webhook to skip pods that have custom nodeSelectors but no kubernetes.io/os selector. These are test fixture pods (e.g., ResourceQuota tests with x-test.k8s.io/unsatisfiable selectors) that are not intended to run as Windows workloads.

Why this is needed

After PR #560 added Pod Overhead (512Mi memory, 100m CPU) to the runhcs-wcow-hypervisor RuntimeClass, the webhook injects this RuntimeClass into all pods that aren't explicitly Linux, HostProcess, or HostNetwork. This includes test fixture pods that never run on Windows nodes, causing 4 consistent ResourceQuota test failures on capz-windows-master-hyperv:

pods "test-pod" is forbidden: exceeded quota: test-quota,
  requested: memory=764Mi,     <- 252Mi (pod) + 512Mi (overhead)
  limited: memory=500Mi

How the fix works

Pod nodeSelector Before After
{} (empty, common in e2e tests) INJECT INJECT (unchanged)
{kubernetes.io/os: windows} INJECT INJECT (unchanged)
{kubernetes.io/os: linux} SKIP SKIP (unchanged)
{x-test.k8s.io/unsatisfiable: ...} INJECT (wrong) SKIP (fixed)
{tier: frontend} (no OS) INJECT SKIP (fixed)

CI Impact

Fixes 4 consistent failures on capz-windows-master-hyperv:

  • ResourceQuota should create a ResourceQuota and capture the life of a pod
  • ResourceQuota should verify ResourceQuota with terminating scopes
  • ResourceQuota should verify ResourceQuota with terminating scopes through scope selectors
  • ResourceQuota priority class scope (cpu, memory quota set)

/cc @jsturtevant @kiashok

The webhook injects the runhcs-wcow-hypervisor RuntimeClass into all
pods except HostProcess, HostNetwork, and explicitly Linux pods. This
causes test fixture pods (e.g., ResourceQuota tests with unsatisfiable
nodeSelectors) to receive 512Mi Pod Overhead, breaking resource
accounting in those tests.

Add a check to skip pods that have custom nodeSelectors but no
kubernetes.io/os selector. These are likely test fixtures, not actual
Windows workloads.
@k8s-ci-robot k8s-ci-robot added tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 4, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @rzlink. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 4, 2026
@marosset

marosset commented May 4, 2026

Copy link
Copy Markdown
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 4, 2026
@marosset

marosset commented May 4, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 4, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: marosset, rzlink

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

The pull request process is described here

Details 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 4, 2026
@k8s-ci-robot k8s-ci-robot merged commit 011f344 into kubernetes-sigs:master May 4, 2026
4 checks passed
@rzlink rzlink deleted the fix/webhook-skip-non-windows-pods branch June 1, 2026 20:54
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants