Skip to content

[main] Add admission validation for WebhookDeploymentCustomization#1465

Open
crobby wants to merge 2 commits into
rancher:mainfrom
crobby:webhook-deployment-validation
Open

[main] Add admission validation for WebhookDeploymentCustomization#1465
crobby wants to merge 2 commits into
rancher:mainfrom
crobby:webhook-deployment-validation

Conversation

@crobby
Copy link
Copy Markdown
Collaborator

@crobby crobby commented May 13, 2026

Issue: rancher/rancher#54090

Problem

Invalid WebhookDeploymentCustomization values (zero replicas, malformed toleration keys, conflicting PDB fields) pass through the API and only fail at Helm install time on the downstream cluster, making errors difficult to diagnose.

Solution

Add admission validators for WebhookDeploymentCustomization on both provisioning.cattle.io/v1 and management.cattle.io/v3 Cluster resources:

  • replicaCount must be >= 1
  • Toleration keys validated against k8s label name rules
  • Affinity label selectors validated via apimachinery
  • PDB: must be non-negative int or 0-100% string; minAvailable and maxUnavailable cannot both be non-zero

Built on top of #1327 (HA chart support).

Depends on rancher/rancher#54335 (adds WebhookDeploymentCustomization type to the API).

@crobby crobby marked this pull request as ready for review May 18, 2026 18:39
@crobby crobby requested a review from a team as a code owner May 18, 2026 18:39
@crobby crobby force-pushed the webhook-deployment-validation branch 2 times, most recently from 764e852 to ff06e2a Compare May 26, 2026 20:40
@crobby crobby changed the title Add admission validation for WebhookDeploymentCustomization [main] Add admission validation for WebhookDeploymentCustomization May 26, 2026
Validate WebhookDeploymentCustomization fields on both provisioning.cattle.io/v1
and management.cattle.io/v3 Cluster resources:
- replicaCount must be >= 1
- appendTolerations keys validated against k8s label name rules
- overrideAffinity label selectors validated
- PDB minAvailable/maxUnavailable: non-negative int or 0-100% string,
  cannot both be non-zero simultaneously
@crobby crobby force-pushed the webhook-deployment-validation branch from ff06e2a to 018aebb Compare May 27, 2026 09:57
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.

1 participant