Helm lookup Function Support
Hello, Happy new year Guys !! So, I have this requirement to build the imagePath by reading the dockerRegistryIP value from configMap, so that I need not ask user explicitly where the registry is located. ``` apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "helm-guestbook.fullname" . }} spec: containers: - name: {{ .Chart.Name }} image: {{ printf "%s/%s:%s" **$dockerRegistryIP** .Values.image.repository .Values.image.tag }} ``` Helm3 has introduced support for this where they introduced a **lookup** function through which configMap can be read at runtime like this, `{{ (lookup "v1" "ConfigMap" "default" "my-configmap").data.registryURL}}` But the lookup function will return nil when templates are rendered using "helm dryrun" or "helm template" as a result when you parse a field on nil, you will see an exception like this, "nil pointer evaluating interface {}.registryURL Use --debug flag to render out invalid YAML" The solution which was proposed on stack overflow is to use "helm template --validate" instead of "helm template" Can you guys add support for this ? Right now am populating docker-registry-ip like this, but with this kustomize-plugin approach am loosing the ability to render values.yaml file as an config screen through which user can override certain values i.e. the fix to solve one issue has lead to an other issue ``` kubectl -n argocd get cm argocd-cm -o yaml apiVersion: v1 data: configManagementPlugin
Posted by rajivml on Jan 7, 2021, 4:21 AM
Tags
Related issues
- Add 65536 size support for maps
- TypeScript 7.1 Iteration Plan
- nvim-treeconfig: upstream nvim-treesitter
- Add the "action" and "method" attributes to <button>
- [FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
- > We were imposed GitHub for so many exercises!
Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments
support (Software)
Add 65536 size support for maps
TypeScript 7.1 Iteration Plan
nvim-treeconfig: upstream nvim-treesitter
Add the "action" and "method" attributes to <button>
[FEATURE] Support multiple Connector accounts (same connector, different accounts) in Claude and Claude Code on the web (claude.ai/code)
> We were imposed GitHub for so many exercises!
Add support for Visual Studio 2026 Integration
Support for Helm v4
Helm lookup Function Support
Hello, Happy new year Guys !! So, I have this requirement to build the imagePath by reading the dockerRegistryIP value from configMap, so that I need not ask user explicitly where the registry is located. ``` apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "helm-guestbook.fullname" . }} spec: containers: - name: {{ .Chart.Name }} image: {{ printf "%s/%s:%s" **$dockerRegistryIP** .Values.image.repository .Values.image.tag }} ``` Helm3 has introduced support for this where they introduced a **lookup** function through which configMap can be read at runtime like this, `{{ (lookup "v1" "ConfigMap" "default" "my-configmap").data.registryURL}}` But the lookup function will return nil when templates are rendered using "helm dryrun" or "helm template" as a result when you parse a field on nil, you will see an exception like this, "nil pointer evaluating interface {}.registryURL Use --debug flag to render out invalid YAML" The solution which was proposed on stack overflow is to use "helm template --validate" instead of "helm template" Can you guys add support for this ? Right now am populating docker-registry-ip like this, but with this kustomize-plugin approach am loosing the ability to render values.yaml file as an config screen through which user can override certain values i.e. the fix to solve one issue has lead to an other issue ``` kubectl -n argocd get cm argocd-cm -o yaml apiVersion: v1 data: configManagementPlugin
Comments (0)
No comments yet. Start the discussion.