Comments (15)
The issue is that a dash is included in {{ .Values.image.debug-port }}
which is not supported. If you change it to {{ index .Values "image" "debug-port" }}
, Helm will no longer produce en error
from helm.
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" }}
- name: debug-port
containerPort: {{ .Values.image.debugport }}
hostPort: {{ .Values.image.debugport }}
{{- end }}
Error: parse error at (test/templates/daemonset.yaml:59): bad character U+002D '-'
{{- if eq (index .Values.configMap "test-config" "services-debug") "true" }}
- name: debug-port
containerPort: {{ .Values.image.debugport }}
hostPort: {{ .Values.image.debugport }}
{{- end }}
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
from helm.
{{- if eq (index .Values.configMap "test-config" "services-debug" | toString) "true" }}
Values:
configMap:
test-config:
services-debug: false
image:
debug-port: 81
from helm.
Still getting the same error with {{- if eq (index .Values.configMap "test-config" "services-debug" | toString) "true" }}
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.
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}
data:
services-debug: true
This is deployed a test-config
from helm.
@nchitimilla Can you please share as much information as possible. Your values.yaml
and template files
from helm.
Provided all the necessary filles
daemonset.yaml:
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Chart.Name }}
annotations:
reloader.stakater.com/match: "true"
data:
services-debug: {{ .Values.servicesdebug | quote }}
values.yaml
servicesdebug: false
daemonset.yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: {{ .Chart.Name }}
annotations:
reloader.stakater.com/auto: "true"
spec:
hostNetwork: yes
containers:
ports:
- name: http-port
containerPort: {{ .Values.image.porthttp }}
hostPort: {{ .Values.image.porthttp }}
- name: debug-port
containerPort: {{ .Values.image.debugport }}
hostPort: {{ .Values.image.debugport }}
values.yaml
image:
porthttp: 8080
debugport: 8081
from helm.
@nchitimilla This structure looks totally different than the original issue.
Are you testing against the servicesdebug
property in the values.yaml
file and then will enable the debug-port
based upon it?
from helm.
@nchitimilla This structure looks totally different than the original issue.
Are you testing against the
servicesdebug
property in thevalues.yaml
file and then will enable thedebug-port
based upon it?
Yes. If the servicesdebug is true we would like to enable the debug port
from helm.
@nagraj321 @nchitimilla why are there 2 values.yaml
files? A since this is a relatively flat structure, you can just perform a simple check and it should work without issue. You can remove all of the complex index
logic
from helm.
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.
from helm.
so we can assume there is a ConfigMap where you want to look up a value already on the cluster?
from helm.
so we can assume there is a ConfigMap where you want to look up a value already on the cluster?
Yes
from helm.
You would want to use the lookup
filter
from helm.
You would want to use the
lookup
filter
If you can give some example or link to documentation will be helpful.
from helm.
You would want to use the
lookup
filterIf 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
from helm.
Related Issues (20)
- Helm Chart Dependency Versions in chart.lock Not Matching Specified Versions
- Helm doesn't report the right status of the job
- Is mapkubeapis plugin recommended for production by helm for manipulating release manifest ?
- Version 3.15.0 for linux-amd64 is not published. HOT 2
- binary from helm-v3.15.0-linux-amd64.tar.gz reports wrong version HOT 1
- json value gets merged when using custom values yaml file instead of overriding
- Use of Helm build-in objects in Helm templates inside JSON files
- Make funcMap public for unit testing syntax of templates
- The randAscii function returns an error after multiple --dry-run tests HOT 2
- link for 3.15.1 for MacOS - amd64 once download gave me version 3.14.2 using "helm version" HOT 1
- JSON Schema 2019 & 2020 Support
- helm repo proxy redirecting HOT 2
- Helm Lookup as a CLI option for values HOT 3
- go package for validate a values.yaml from a values.schema.json HOT 1
- Enhancement: Allow deep overriding of Values in a list using `-f values.yaml` the way it works with `--set` HOT 2
- Helm silently fails when templating/installing different versions of the same chart name.
- Helm incorrect processes nodeSelecto with GPU Nodes HOT 1
- add / update Supported Kubernetes Versions page to have 3.15 version HOT 1
- Helm CLI should add "helm sink" to uninstall HOT 1
- Upgrade release with helm SDK got error: cannot patch "xxxx-deploy" with kind Deployment HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from helm.