Files
Vedant DeshpandeandGitHub 60fba0cbc5 fix(webhook): Fix path for mutating ScheduledSparkApplication, correct sideEffects, remove update verb in manifests (#2915)
* fix(webhook): Bug Fix path for mutating ScheduledSparkApplication, correct sideEffects, remove update verb
- Change sideEffects from None to NoneOnDryRun on all webhook markers to match Helm chart and correctly declare dry-run safety
- Remove UPDATE verb from pod mutating webhook (CREATE only) to avoid unnecessary overhead on pod updates cluster-wide
- Bug Fix ScheduledSparkApplication set mutating=true and correct the path
- Regenerate config/webhook/manifests.yaml to reflect marker changes

Signed-off-by: Vedant Deshpande <[email protected]>
Signed-off-by: Vedant Deshpande <[email protected]>

* fix(webhook): Fix doc comments, correct sideEffects to None, add defaulter test
- Fix copy-paste doc comment errors in scheduledsparkapplication_defaulter.go (was referencing SparkApplication/SparkApplicationValidator instead of ScheduledSparkApplication/ScheduledSparkApplicationDefaulter)
- Fix doc comment in sparkapplication_defaulter.go (NewSparkApplicationValidator -> NewSparkApplicationDefaulter)
- Add no-op placeholder comment on Default() explaining it is intentional scaffolding for future defaulting logic
- Change sideEffects from NoneOnDryRun to None on all webhook markers, since these webhooks have no side effects (defaulters only mutate the admitted object, validators only return allow/deny)
- Add scheduledsparkapplication_defaulter_test.go to verify the kubebuilder marker generates the correct manifest entry (path, mutating flag, resource) and regression-test against the original routing bug
- Regenerate config/webhook/manifests.yaml

Signed-off-by: Vedant Deshpande <[email protected]>

---------

Signed-off-by: Vedant Deshpande <[email protected]>
Signed-off-by: Vedant Deshpande <[email protected]>
2026-05-08 16:09:29 +00:00

163 lines
3.5 KiB
YAML

---
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
metadata:
name: mutating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate--v1-pod
failurePolicy: Fail
matchPolicy: Exact
name: mutate-pod.sparkoperator.k8s.io
reinvocationPolicy: Never
rules:
- apiGroups:
- ""
apiVersions:
- v1
operations:
- CREATE
resources:
- pods
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate-sparkoperator-k8s-io-v1beta2-scheduledsparkapplication
failurePolicy: Fail
matchPolicy: Exact
name: mutate-scheduledsparkapplication.sparkoperator.k8s.io
reinvocationPolicy: Never
rules:
- apiGroups:
- sparkoperator.k8s.io
apiVersions:
- v1beta2
operations:
- CREATE
- UPDATE
resources:
- scheduledsparkapplications
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate-sparkoperator-k8s-io-v1beta2-sparkapplication
failurePolicy: Fail
matchPolicy: Exact
name: mutate-sparkapplication.sparkoperator.k8s.io
reinvocationPolicy: Never
rules:
- apiGroups:
- sparkoperator.k8s.io
apiVersions:
- v1beta2
operations:
- CREATE
- UPDATE
resources:
- sparkapplications
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /mutate-sparkoperator-k8s-io-v1alpha1-sparkconnect
failurePolicy: Fail
matchPolicy: Exact
name: mutate-sparkconnect.sparkoperator.k8s.io
reinvocationPolicy: Never
rules:
- apiGroups:
- sparkoperator.k8s.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- sparkconnects
sideEffects: None
---
apiVersion: admissionregistration.k8s.io/v1
kind: ValidatingWebhookConfiguration
metadata:
name: validating-webhook-configuration
webhooks:
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-sparkoperator-k8s-io-v1beta2-scheduledsparkapplication
failurePolicy: Fail
matchPolicy: Exact
name: validate-scheduledsparkapplication.sparkoperator.k8s.io
rules:
- apiGroups:
- sparkoperator.k8s.io
apiVersions:
- v1beta2
operations:
- CREATE
- UPDATE
resources:
- scheduledsparkapplications
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-sparkoperator-k8s-io-v1beta2-sparkapplication
failurePolicy: Fail
matchPolicy: Exact
name: validate-sparkapplication.sparkoperator.k8s.io
rules:
- apiGroups:
- sparkoperator.k8s.io
apiVersions:
- v1beta2
operations:
- CREATE
- UPDATE
resources:
- sparkapplications
sideEffects: None
- admissionReviewVersions:
- v1
clientConfig:
service:
name: webhook-service
namespace: system
path: /validate-sparkoperator-k8s-io-v1alpha1-sparkconnect
failurePolicy: Fail
matchPolicy: Exact
name: validate-sparkconnect.sparkoperator.k8s.io
rules:
- apiGroups:
- sparkoperator.k8s.io
apiVersions:
- v1alpha1
operations:
- CREATE
- UPDATE
resources:
- sparkconnects
sideEffects: None