New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enable ports based on the config value in the kubernates #12965
Comments
The issue is that a dash is included in |
we have changed the "debug-port" in the values.ymal to "debugport" and updated the daemonset.yaml respectively. But still getting the same error. {{- if eq (index .Values.configMap.test-config "services-debug") "true" }}
Error: parse error at (test/templates/daemonset.yaml:59): bad character U+002D '-' {{- if eq (index .Values.configMap "test-config" "services-debug") "true" }}
templates/daemonset.yaml:59:20: executing "test/templates/daemonset.yaml" at <index .Values.configMap "test-config" "services-debug">: error calling index: index of untyped nil |
Values:
|
Still getting the same error with test/templates/daemonset.yaml:59:20: executing "test/templates/daemonset.yaml" at <index .Values.configMap "test-config" "services-debug">: error calling index: index of untyped nil Note: the we dont have the services-debug value in values.yaml instead we have a config map where we define services-debug value. e.g.
This is deployed a test-config |
@nchitimilla Can you please share as much information as possible. Your |
Provided all the necessary filles daemonset.yaml: values.yaml daemonset.yaml values.yaml |
@nchitimilla This structure looks totally different than the original issue. Are you testing against the |
Yes. If the servicesdebug is true we would like to enable the debug port |
@nagraj321 @nchitimilla why are there 2 |
First daemons.yaml and values.yaml are deployed as a one service i.e. test-config which will have the common details required by the other services. Other daemonset.yaml and values.yaml are related to some other service. We can’t club together as this test-config service is being used by nearly 10 other services. Now we need to look up if we have a debug enabled in the test-config service then we need to enable the debug port. |
so we can assume there is a ConfigMap where you want to look up a value already on the cluster? |
Yes |
You would want to use the |
If you can give some example or link to documentation will be helpful. |
https://helm.sh/docs/chart_template_guide/functions_and_pipelines/#using-the-lookup-function |
What happened?
I have the following daemonset.yaml my requirement is we need to enable the debug port only if services-debug is set to true.
i have tried the following option
but when we use it helm is throwing
Error: parse error at (test/templates/daemonset.yaml:59): bad character U+002D '-'
also tried
but giving
templates/daemonset.yaml:59:20: executing "test/templates/daemonset.yaml" at <index .Values.configMap "test-config" "services-debug">: error calling index: index of untyped nil
What did you expect to happen?
it should procced without any errors
How can we reproduce it (as minimally and precisely as possible)?
crated a config map and key which contains the hyphen in it.
Try to use the configmap key in the if condition.
Kubernetes version
OS version
Output of
helm version
:version.BuildInfo{Version:"v3.4.1", GitCommit:"c4e74854886b2efe3321e185578e6db9be0a6e29", GitTreeState:"clean", GoVersion:"go1.14.11"}
The text was updated successfully, but these errors were encountered: