Giter Club home page Giter Club logo

Comments (15)

sabre1041 avatar sabre1041 commented on June 8, 2024

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.

nchitimilla avatar nchitimilla commented on June 8, 2024

@sabre1041

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.

sabre1041 avatar sabre1041 commented on June 8, 2024
 {{- if eq (index .Values.configMap "test-config" "services-debug" | toString) "true" }}

Values:

configMap:
  test-config:
    services-debug: false
image:
  debug-port: 81

from helm.

nchitimilla avatar nchitimilla commented on June 8, 2024

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.

sabre1041 avatar sabre1041 commented on June 8, 2024

@nchitimilla Can you please share as much information as possible. Your values.yaml and template files

from helm.

nchitimilla avatar nchitimilla commented on June 8, 2024

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.

sabre1041 avatar sabre1041 commented on June 8, 2024

@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.

nagraj321 avatar nagraj321 commented on June 8, 2024

@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?

Yes. If the servicesdebug is true we would like to enable the debug port

from helm.

sabre1041 avatar sabre1041 commented on June 8, 2024

@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.

nagraj321 avatar nagraj321 commented on June 8, 2024

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.

sabre1041 avatar sabre1041 commented on June 8, 2024

so we can assume there is a ConfigMap where you want to look up a value already on the cluster?

from helm.

nchitimilla avatar nchitimilla commented on June 8, 2024

so we can assume there is a ConfigMap where you want to look up a value already on the cluster?

Yes

from helm.

sabre1041 avatar sabre1041 commented on June 8, 2024

You would want to use the lookup filter

from helm.

nagraj321 avatar nagraj321 commented on June 8, 2024

You would want to use the lookup filter

If you can give some example or link to documentation will be helpful.

from helm.

sabre1041 avatar sabre1041 commented on June 8, 2024

You would want to use the lookup filter

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

from helm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.