Skip to content

Define unresolved PVC admission behavior - #645

Open
Hrishikesh Kashyap (Hrishikeshkashyap) wants to merge 4 commits into
Azure:mainfrom
Hrishikeshkashyap:fix/claim-resolution-admission
Open

Hrishikesh Kashyap (Hrishikeshkashyap) wants to merge 4 commits into
Azure:mainfrom
Hrishikeshkashyap:fix/claim-resolution-admission

Conversation

@Hrishikeshkashyap

@Hrishikeshkashyap Hrishikesh Kashyap (Hrishikeshkashyap) commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

A missing PVC previously caused the webhook to allow the entire Pod early,
discarding placement constraints from other resolved volumes.

Changes

  • Preserve Pod-before-PVC behavior: skip missing ordinary claims and continue
    processing other volumes.
  • Confirm PVC cache misses with an uncached API read before treating claims
    as missing.
  • Derive generic-ephemeral claim names as <pod-name>-<volume-name>.
  • Preserve resolved placement constraints alongside missing, generic-ephemeral,
    and unbound claims.
  • Surface PVC lookup errors.

Tests

Focused Linux webhook unit tests, manager cross-build, go vet, spelling,
and whitespace checks passed. Regression coverage includes both volume orders,
Pod-before-PVC, cache-miss/API-hit, API failures, and cached-claim reads.

Integration tests were not run locally because envtest binaries are unavailable.

Limitation

Creating a missing PVC later does not rerun Pod admission, so the webhook
cannot retroactively add that claim's placement constraints to an existing Pod.

@Hrishikeshkashyap

Copy link
Copy Markdown
Contributor Author

The External E2E failure appears capacity-related: the test Pod remained Pending because the single Kind node reported insufficient free storage. The regular amd64/arm64 E2E and CSI sanity checks passed. Could someone with repository permissions rerun the failed job?
Trivy is flagging CVE-2026-78669 in golang.org/x/net v0.59.0; versions before v0.60.0 are affected.
The same check is failing on #643, #645, and #646, and upstream main is still on v0.59.0.

Comment thread internal/webhook/hyperconverged/handler.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Stale PVC cache misses can incorrectly reject Pods whose claims already exist.

1 open finding
What changed in this PR

Defines unresolved-claim admission behavior while preserving placement constraints from resolved volumes.

Changes:

  • Denies Pods referencing missing ordinary PVCs.
  • Corrects generic-ephemeral claim naming and continues processing unresolved claims.
  • Adds regression tests and documents the behavior.
File Description
internal/​webhook/​hyperconverged/​handler.go Updates claim resolution and admission handling.
internal/​webhook/​hyperconverged/​handler_unit_test.go Tests missing, ephemeral, and unbound claims.
internal/​webhook/​hyperconverged/​handler_test.go Tests missing-claim denial in both volume orders.
docs/​design/​webhooks.md Documents unresolved-claim behavior.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/webhook/hyperconverged/handler.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Generic-ephemeral PVC ownership needs validation, and the new integration test needs cache synchronization.

2 open findings
1 resolved since last review

🧠 Review effort: Balanced

Comment thread internal/webhook/hyperconverged/handler.go
Comment thread internal/webhook/hyperconverged/handler_test.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No blocking issues were identified; regression coverage addresses the changed behavior, though integration tests remain unrun locally.

0 open findings

2 resolved since last review

🧠 Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No blocking issues remain, and regression coverage addresses the changed admission behavior.

No open issues 🎉

Review effort: Balanced

Comment thread internal/webhook/hyperconverged/handler.go Outdated
Comment thread internal/webhook/hyperconverged/handler.go Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new continuation path can weaken application-required affinity, and a diagnostic-only lookup can unnecessarily reject Pod admission.

2 open issues

Review effort: Balanced

Comment thread internal/webhook/hyperconverged/handler.go
Comment thread internal/webhook/hyperconverged/handler.go Outdated
@Hrishikeshkashyap
Hrishikesh Kashyap (Hrishikeshkashyap) force-pushed the fix/claim-resolution-admission branch 2 times, most recently from 3be2d79 to 1646c6e Compare October 27, 2026 16:31

@hasethuraman2 Hari (hasethuraman2) left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looks good to me. It is good to fail the admission when the pod has a PVC that is not resolvable at the time of pod creation.

@jmclong jmclong (jmclong) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verified the rebase includes #643 and reviewed the missing-claim handling, PVC API-reader fallback, and error handling. Focused webhook unit tests pass; CI checks are green. The previously requested changes are addressed.

Reject Pods that reference missing ordinary PVCs so placement is recalculated on a later CREATE. Preserve generic ephemeral and unbound WFFC claims while continuing to enforce resolved durability volumes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Verify ordinary missing claims, generated ephemeral claim naming, and unbound claims preserve resolved durability placement.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Document admission behavior for ordinary, generated ephemeral, and initially unbound claims.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Preserve Pod-before-PVC behavior while enforcing placement from resolved claims. Confirm PVC cache misses with the API reader and surface lookup failures. Update regression tests and correct the unresolved-claim documentation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues were identified in the webhook’s PVC placement-constraint changes.

No open issues 🎉

2 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants