-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
What happened?
The file config/crd/kustomization.yaml contains two issues:
-
Duplicate webhook patch entry: The patch
patches/webhook_in_sparkapplications.yamlis listed twice, which appears to be a copy-paste error. -
Missing patch files for ScheduledSparkApplication: The CA injection section references
patches/cainjection_in_scheduledsparkapplications.yamlbut this file doesn't exist. Similarly, there's nowebhook_in_scheduledsparkapplications.yamlfor the ScheduledSparkApplication CRD.
Affected file: https://github.com/kubeflow/spark-operator/blob/master/config/crd/kustomization.yaml
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
- path: patches/webhook_in_sparkapplications.yaml
- path: patches/webhook_in_sparkapplications.yaml # <-- Duplicate (should be webhook_in_scheduledsparkapplications.yaml)
# +kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
#- path: patches/cainjection_in_scheduledsparkapplications.yaml # <-- File doesn't exist
#- path: patches/cainjection_in_sparkapplications.yaml
# +kubebuilder:scaffold:crdkustomizecainjectionpatchReproduction Code
-
Clone the spark-operator repository:
git clone https://github.com/kubeflow/spark-operator.git cd spark-operator -
Check the contents of
config/crd/kustomization.yaml:cat config/crd/kustomization.yaml
-
Observe lines 12-13 have the same patch entry:
- path: patches/webhook_in_sparkapplications.yaml - path: patches/webhook_in_sparkapplications.yaml
-
List the available patch files in
config/crd/patches/:ls config/crd/patches/
Output shows only patches for SparkApplication exist:
cainjection_in_sparkapplications.yaml webhook_in_sparkapplications.yamlMissing files:
webhook_in_scheduledsparkapplications.yamlcainjection_in_scheduledsparkapplications.yaml
Expected behavior
The patches section should have entries for each CRD with corresponding patch files:
patches:
# [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix.
# patches here are for enabling the conversion webhook for each CRD
- path: patches/webhook_in_sparkapplications.yaml
- path: patches/webhook_in_scheduledsparkapplications.yaml
# +kubebuilder:scaffold:crdkustomizewebhookpatch
# [CERTMANAGER] To enable cert-manager, uncomment all the sections with [CERTMANAGER] prefix.
# patches here are for enabling the CA injection for each CRD
#- path: patches/cainjection_in_scheduledsparkapplications.yaml
#- path: patches/cainjection_in_sparkapplications.yaml
# +kubebuilder:scaffold:crdkustomizecainjectionpatchAnd the config/crd/patches/ directory should contain:
cainjection_in_scheduledsparkapplications.yaml # NEW
cainjection_in_sparkapplications.yaml
webhook_in_scheduledsparkapplications.yaml # NEW
webhook_in_sparkapplications.yaml
Actual behavior
The same patch file patches/webhook_in_sparkapplications.yaml is referenced twice, and cainjection_in_scheduledsparkapplications.yaml is referenced but doesn't exist:
patches:
- path: patches/webhook_in_sparkapplications.yaml
- path: patches/webhook_in_sparkapplications.yaml # Duplicate entryWhile this doesn't cause a functional issue (Kustomize applies the patch twice idempotently), it:
- Indicates an oversight where patches for ScheduledSparkApplication CRD are missing
- Would cause an error if the CA injection section is uncommented (file not found)
- Creates confusion about whether this was intentional
- Should be cleaned up for code clarity and completeness
Environment & Versions
- Kubernetes Version:
- Spark Operator Version:
- Apache Spark Version:
Additional context
No response
Impacted by this bug?
Give it a 👍 We prioritize the issues with most 👍