rg2609 opened a new issue, #52645:
URL: https://github.com/apache/airflow/issues/52645

   ### Official Helm Chart version
   
   1.17.0 (latest released)
   
   ### Apache Airflow version
   
   3.0.2
   
   ### Kubernetes Version
   
   1.33.0
   
   ### Helm Chart configuration
   
   I am using the following yaml file 
[values.yaml](https://github.com/apache/airflow/blob/helm-chart/1.17.0/chart/values.yaml)
   
   ### Docker Image customizations
   
   _No response_
   
   ### What happened
   
   When deploying the Airflow Helm chart, I encounter the following error 
during template rendering if .Values.config.api.base_url is not set:
   
   ```
   Error: template: airflow/templates/workers/worker-deployment.yaml:101:36: 
executing "airflow/templates/workers/worker-deployment.yaml" at <include (print 
$.Template.BasePath "/configmaps/configmap.yaml") .>: error calling include: 
template: airflow/templates/configmaps/configmap.yaml:46:38: executing 
"airflow/templates/configmaps/configmap.yaml" at <$config.api.base_url>: nil 
pointer evaluating interface {}.base_url
   ```
   
   ### What you think should happen instead
   
   The template should render successfully even if 
`.Values.config.api.base_url` is not set, without throwing a nil pointer error.
   
   ### How to reproduce
   
   Steps to reproduce the behavior:
   1. Use the Airflow Helm chart (version: [1.17.0])
   2. Do **not** set `.Values.config.api.base_url` in your `values.yaml`
   3. Run `terraform apply`
   4. Observe the error above
   
   ### Anything else
   
   **What I Tried**
   
   I attempted to make the template more defensive using
   ```
   {{- if and $config.api (hasKey $config.api "base_url") -}}
   ```
   and
   ```
   {{- $api := default (dict) $config.api }}
   {{- if hasKey $api "base_url" -}}
   ```
   However, the error persists, especially when $config.api is not defined at 
all.
   
   ### Are you willing to submit PR?
   
   - [x] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of 
Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to