Skip to content
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

Help with pluck and pick #85

Closed
pkrishn6 opened this issue Mar 14, 2018 · 0 comments
Closed

Help with pluck and pick #85

pkrishn6 opened this issue Mar 14, 2018 · 0 comments

Comments

@pkrishn6
Copy link

{{ $envDict := pick .Values.global .Values.global.env }}
{{ $chartDict := pick $.envDict .Chart.Name }}
{{ $imgDict := pick $.chartDict "image" }}
{{- define "app.release_labels" }}
app: {{ printf "%s-%s" .Release.Name .Chart.Name | trunc 63 }}
version: {{ .Chart.Version }}
release: {{ .Release.Name }}
{{- end }}
{{- define "app.full_name" -}}
{{- printf "%s-%s" .Release.Name .Chart.Name | trunc 63 -}}
{{- end -}}
{{- define "app.repository" -}}
{{- printf "%s" .imgDict.repository | trunc 63 -}}
{{- end -}}
{{- define "app.tag" -}}
{{- printf "%s" .imgDict.tag -}}
{{- end -}}
{{- define "app.replica_count" -}}
{{- printf "%s" $.chartDict.replicaCount-}}
{{- end -}}

I am getting an error: executing "app.replica_count" at <$.charDict.replicaCo...>: can't evaluate field replicaCount in type interface {}

I am using this as a helper file in my helm chart repo. The input file to this looks like this:

global:
env: "dev"
dev:
hello-world:
image:
repository: gcr.io/google-samples
tag: '1.0'
replicaCount: '1'
hello-kube:
image:
repository: gcr.io/google-samples
tag: '1.0'
replicaCount: '1'
stage:
hello-world:
image:
repository: gcr.io/google-samples
tag: '1.0'
replicaCount: '1'
hello-kube:
image:
repository: gcr.io/google-samples
tag: '1.0'
replicaCount: '1'

Can some one please help me with what I am doing wrong?..
Many thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant