kubeflow / spark-operator

Kubernetes operator for managing the lifecycle of Apache Spark applications on Kubernetes.
Apache License 2.0
2.75k stars 1.36k forks source link

[Chart] Webhook init and cleanup template files have wrong toleration block placement #1393

Open HeshamMeneisi opened 2 years ago

HeshamMeneisi commented 2 years ago

Tolerations are placed outside the if block.

This is in both webhook-cleanup-job.yaml and webhook-init-job.yaml

When webhooks are disabled, the file will only contain tolerations which causes this error from helm-operator:

Warning  FailedReleaseSync  104s (x6 over 10m)  helm-operator  synchronization of release 'spark-operator' in namespace 'spark-operator' failed: installation failed: unable to build kubernetes objects from release manifest: error validating "": error validating data: [apiVersion not set, kind not set]
ericvenarusso commented 1 year ago

I had the same problem using nodeSelector. As it is outside the block, the template is generated incorrectly by helm. I was recieving the following error while installing the operator.

[apiVersion not set, kind not set]; if you choose to ignore these errors, turn validation off with --validate=false 

I identified the problem by generating the template and verifying that was incorrect:

helm template charts/spark-operator-chart

Generated template:

nodeSelector:
        app: example
---
# Source: spark-operator/templates/webhook-cleanup-job.yaml
nodeSelector:
        app: example
---
# Source: spark-operator/templates/webhook-init-job.yaml
nodeSelector:
        app: example
---