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

Null values ignored in HelmChartInflationGenerator #5803

Open
erwanval opened this issue Nov 15, 2024 · 1 comment
Open

Null values ignored in HelmChartInflationGenerator #5803

erwanval opened this issue Nov 15, 2024 · 1 comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@erwanval
Copy link

What happened?

Since 5.4.0, there is a regression causing null values in helmChartInflationGenerator to be ignored.
Setting a null value is useful to remove default values present in values.yaml.

I have tried with all versions of kustomize since 5.0.0, and it seems it was fixed in 5.2.0, but reappeared in 5.4.0.

What did you expect to happen?

Setting a null value should overwrite and remove a default values present in values.yaml.

How can we reproduce it (as minimally and precisely as possible)?

# kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization

generators:
  - helmchartinflation-crowdsec.yaml
# helmchartinflation-crowdsec.yaml
apiVersion: builtin
kind: HelmChartInflationGenerator
metadata:
  name: crowdsec
releaseName: crowdsec
namespace: crowdsec
name: crowdsec
repo: https://crowdsecurity.github.io/helm-charts
version: 0.13.0
includeCRDs: true
valuesInline:
  lapi:
    resources:
      requests:
        cpu: 10m
        memory: 100Mi
      limits:
        cpu: null # We want to remove the default from values.yaml
        memory: 100Mi
    persistentVolume:
      config:
        enabled: false
      data:
        enabled: false
  agent:
    resources:
      requests:
        cpu: 10m
        memory: 100Mi
      limits:
        cpu: null # We want to remove the default from values.yaml
        memory: 100Mi
    acquisition:
      - namespace: ingress-nginx
        podName: ingress-nginx-controller-*
        program: nginx

Expected output

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: crowdsec-agent
spec:
  [...]
  template:
    [...]
    spec:
      [...]
      containers:
        [...]
          resources:
            limits:
              memory: 100Mi
            requests:
              cpu: 10m
              memory: 100Mi

Actual output

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: crowdsec-agent
spec:
  [...]
  template:
    [...]
    spec:
      [...]
      containers:
        [...]
          resources:
            limits:
              cpu: 500m # default from values.yaml still set
              memory: 100Mi
            requests:
              cpu: 10m
              memory: 100Mi

Kustomize version

5.4.0

Operating system

None

@erwanval erwanval added the kind/bug Categorizes issue or PR as related to a bug. label Nov 15, 2024
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Nov 15, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

2 participants