You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@polaris.apache.org by "cccs-cat001 (via GitHub)" <gi...@apache.org> on 2025/11/05 14:20:39 UTC

[PR] Fix helm chart error when value cannot be compared to nil [polaris]

cccs-cat001 opened a new pull request, #2983:
URL: https://github.com/apache/polaris/pull/2983

   <!--
   ๐Ÿ“ Describe what changes you're proposing, especially breaking or user-facing changes. 
   ๐Ÿ“– See https://github.com/apache/polaris/blob/main/CONTRIBUTING.md for more.
   -->
   
   I faced an issue deploying the helm chart with this line. I found that comparing with nil is unnecessary, because you can just do what's proposed. Sometimes an object/string/map is incompatible with nil and the helm chart will throw errors. 
   
   ## Checklist
   - [x] ๐Ÿ›ก๏ธ Don't disclose security issues! (contact security@apache.org)
   - [x] ๐Ÿ”— Clearly explained why the changes are needed, or linked related issues: Fixes #
   - [x] ๐Ÿงช Added/updated tests with good coverage, or manually tested (and explained how)
   - [x] ๐Ÿ’ก Added comments for complex logic
   - [x] ๐Ÿงพ Updated `CHANGELOG.md` (if needed)
   - [x] ๐Ÿ“š Updated documentation in `site/content/in-dev/unreleased` (if needed)
   


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix helm chart error when value cannot be compared to nil [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #2983:
URL: https://github.com/apache/polaris/pull/2983#discussion_r2495064387


##########
helm/polaris/templates/_helpers.tpl:
##########
@@ -142,7 +142,7 @@ line breaks, they will be escaped and a multi-line option will be printed.
 {{- $value := index . 1 -}}
 {{- $global := index . 2 -}}
 {{- $valAsString := "" -}}
-{{- if ne $value nil -}}
+{{- if $value -}}

Review Comment:
   OK but what was your values file? So that I can reproduce and debug :-)



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix helm chart error when value cannot be compared to nil [polaris]

Posted by "cccs-cat001 (via GitHub)" <gi...@apache.org>.
cccs-cat001 commented on PR #2983:
URL: https://github.com/apache/polaris/pull/2983#issuecomment-3503207499

   I am very bad at git, it was definitely a mistake ๐Ÿ˜† 
   
   Haven't had the time to create a minimal example for this sorry, I'll get to it next week! 


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix helm chart error when value cannot be compared to nil [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra closed pull request #2983: Fix helm chart error when value cannot be compared to nil
URL: https://github.com/apache/polaris/pull/2983


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix helm chart error when value cannot be compared to nil [polaris]

Posted by "cccs-cat001 (via GitHub)" <gi...@apache.org>.
cccs-cat001 commented on PR #2983:
URL: https://github.com/apache/polaris/pull/2983#issuecomment-3511770387

   I can't seem to reproduce this again. It must've been some config I was using last week that has since changed, or possibly the outdated version of helm that I was using. 
   
   I think we're safe to close this as a user error :P 


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix helm chart error when value cannot be compared to nil [polaris]

Posted by "cccs-cat001 (via GitHub)" <gi...@apache.org>.
cccs-cat001 commented on code in PR #2983:
URL: https://github.com/apache/polaris/pull/2983#discussion_r2494846559


##########
helm/polaris/templates/_helpers.tpl:
##########
@@ -142,7 +142,7 @@ line breaks, they will be escaped and a multi-line option will be printed.
 {{- $value := index . 1 -}}
 {{- $global := index . 2 -}}
 {{- $valAsString := "" -}}
-{{- if ne $value nil -}}
+{{- if $value -}}

Review Comment:
   I really have no idea what values it was failing on. Helm has been pretty useless in telling me where it went wrong. 
   ```
   Error: template: catalog/charts/polaris/templates/configmap.yaml:216:7: executing "catalog/charts/polaris/templates/configmap.yaml" at <include "polaris.appendConfigOption" (list $k $v $global)>: error calling include: template: catalog/charts/polaris/templates/_helpers.tpl:145:7: executing "polaris.appendConfigOption" at <ne $value nil>: error calling ne: incompatible types for comparison
   helm.go:81: [debug] template: catalog/charts/polaris/templates/configmap.yaml:216:7: executing "catalog/charts/polaris/templates/configmap.yaml" at <include "polaris.appendConfigOption" (list $k $v $global)>: error calling include: template: catalog/charts/polaris/templates/_helpers.tpl:145:7: executing "polaris.appendConfigOption" at <ne $value nil>: error calling ne: incompatible types for comparison
   ```
   



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix helm chart error when value cannot be compared to nil [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on PR #2983:
URL: https://github.com/apache/polaris/pull/2983#issuecomment-3512346318

   Thanks for confirming that everything is working on your end @cccs-cat001 ! Closing as per your request.


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix helm chart error when value cannot be compared to nil [polaris]

Posted by "dimas-b (via GitHub)" <gi...@apache.org>.
dimas-b commented on PR #2983:
URL: https://github.com/apache/polaris/pull/2983#issuecomment-3503152521

   @cccs-cat001 you pushed and closed this PR? Was it intentional or by mistake? :)


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix helm chart error when value cannot be compared to nil [polaris]

Posted by "cccs-cat001 (via GitHub)" <gi...@apache.org>.
cccs-cat001 closed pull request #2983: Fix helm chart error when value cannot be compared to nil
URL: https://github.com/apache/polaris/pull/2983


-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] Fix helm chart error when value cannot be compared to nil [polaris]

Posted by "adutra (via GitHub)" <gi...@apache.org>.
adutra commented on code in PR #2983:
URL: https://github.com/apache/polaris/pull/2983#discussion_r2494772794


##########
helm/polaris/templates/_helpers.tpl:
##########
@@ -142,7 +142,7 @@ line breaks, they will be escaped and a multi-line option will be printed.
 {{- $value := index . 1 -}}
 {{- $global := index . 2 -}}
 {{- $valAsString := "" -}}
-{{- if ne $value nil -}}
+{{- if $value -}}

Review Comment:
   We really want this to be `if ne $value nil`. This is unusual, I know, but here we need to distinguish other zero-values from nil. For example, `foo: false` or `foo: 0` should result in the config property `foo` being included in the ConfigMap, with value `false` or `0`.
   
   If we change this as you suggested, these properties would not be included.
   
   Taking a step back, can you show us a test case that is currently failing? This would help us understand your issue and fix it. Thanks!



-- 
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: issues-unsubscribe@polaris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org