bito-code-review[bot] commented on PR #41396:
URL: https://github.com/apache/superset/pull/41396#issuecomment-4949112288

   <!-- Bito Reply -->
   The flagged issue is correct. Directly accessing 
`.Values.init.istio.terminateSidecarOnExit` will cause a template rendering 
error if `init.istio` is null or missing in the override values. To resolve 
this, you should use the `dig` function to safely access the nested value with 
a default of `false`.
   
   Here is the corrected code for `helm/superset/templates/_helpers.tpl`:
   
   ```yaml
   {{- define "superset.initScript" -}}
   #!/bin/sh
   set -eu
   {{- if (dig "istio" "terminateSidecarOnExit" false .Values.init) }}
   # Notify the Istio pilot-agent sidecar to exit when this script completes
   # (whether successfully or via `set -e`), so that the Job can reach the
   # Completed state instead of hanging on a still-running envoy-proxy.
   # See https://github.com/apache/superset/issues/25798
   trap 'rc=$?; curl -fsS -m 5 -X POST {{ (dig "istio" "quitEndpoint" 
"http://localhost:15020/quitquitquit"; .Values.init) | quote }} >/dev/null 2>&1 
|| true; exit $rc' EXIT
   {{- end }}
   echo "Upgrading DB schema..."
   ```
   
   I have implemented the fix using `dig` for both `terminateSidecarOnExit` and 
`quitEndpoint` to ensure robustness. There are no other comments on this PR to 
address.
   
   **helm/superset/templates/_helpers.tpl**
   ```
   {{- define "superset.initScript" -}}
   #!/bin/sh
   set -eu
   {{- if (dig "istio" "terminateSidecarOnExit" false .Values.init) }}
   # Notify the Istio pilot-agent sidecar to exit when this script completes
   # (whether successfully or via `set -e`), so that the Job can reach the
   # Completed state instead of hanging on a still-running envoy-proxy.
   # See https://github.com/apache/superset/issues/25798
   trap 'rc=$?; curl -fsS -m 5 -X POST {{ (dig "istio" "quitEndpoint" 
"http://localhost:15020/quitquitquit"; .Values.init) | quote }} >/dev/null 2>&1 
|| true; exit $rc' EXIT
   {{- end }}
   echo "Upgrading DB schema..."
   ```


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to