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

nil pointer error when the if statement evaluate the missing "key" #905

Closed
chrisduong opened this issue Jun 30, 2022 · 1 comment
Closed

Comments

@chrisduong
Copy link

chrisduong commented Jun 30, 2022

Terraform, Provider, Kubernetes and Helm Versions

The error happens when the Helm template if statement evaluate the missing "key" ( it's the override key in this case)

initContainers:
      - name: aws-vpc-cni-init
        image: "{{- if .Values.init.image.override }}{{- .Values.init.image.override }}{{- else }}{{- .Values.init.image.account }}.dkr.ecr.{{- .Values.init.image.region }}.{{- .Values.init.image.domain }}/amazon-k8s-cni-init:{{- .Values.init.image.tag }}{{- end}}"
Terraform version: v1.2.3
Provider version:  v2.6.0
Kubernetes version: 1.22.9

Affected Resource(s)

  • helm_release

Terraform Configuration Files

namespace = "kube-system"

  name       = "aws-vpc-cni"
  repository = "https://aws.github.io/eks-charts"
  chart      = "aws-vpc-cni"
  version    = "1.1.17"

  set {
    name  = "wait"
    value = var.wait_for_helm_release
  }
}

Default Chart values for reference:

init:
  image:
    tag: v1.11.2
    region: us-west-2
    account: "602401143452"   
    pullPolicy: Always
    domain: "amazonaws.com"  

Debug Output

Error: template: aws-vpc-cni/templates/daemonset.yaml:65:32: executing "aws-vpc-cni/templates/daemonset.yaml" at <.Values.image.override>: nil pointer evaluating interface {}.override

Panic Output

Steps to Reproduce

  1. terraform apply

Expected Behavior

Helm rendered the templates successfully. It actually works with Helm 3.

Actual Behavior

Important Factoids

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@chrisduong chrisduong added the bug label Jun 30, 2022
@github-actions
Copy link

github-actions bot commented Jul 1, 2023

Marking this issue as stale due to inactivity. If this issue receives no comments in the next 30 days it will automatically be closed. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. This helps our maintainers find and focus on the active issues. Maintainers may also remove the stale label at their discretion. Thank you!

@github-actions github-actions bot added the stale label Jul 1, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant