Skip to content

Setting logLevel to 0 (as integer) in helm chart values doesn't render into container args #5836

@ChrisDevo

Description

@ChrisDevo

Describe the bug:
Setting the logLevel to 0 in the helm chart values is supposed to pass a verbosity arg to the container in the rendered deployment manifests. Instead, if the global.logLevel value is set to 0 (as an unquoted integer) in the helm command or passed in as an entry in the values.yaml (or other file), no verbosity arg is rendered for the deployment container specs.

Expected behavior:
Setting the global.logLevel value (either via a file passed to the helm command or using the --set global.logLevel=0) should render the following deployment manifest:

---
# Source: cert-manager/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
...
spec:
  ...
  template:
    ...
    spec:
       ...
       containers:
        - name: cert-manager-controller
          image: "quay.io/jetstack/cert-manager-controller:v1.11.0"
          ...
          args:
          - --v=0
          - --cluster-resource-namespace=$(POD_NAMESPACE)
          ...
        ...

Steps to reproduce the bug:
For example,

helm template cert-manager jetstack/cert-manager \
  --version v1.11.0 \
  --set global.logLevel=0 \
  --dry-run --output-dir helm

renders the following args in the deployment manifest:

---
# Source: cert-manager/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
...
spec:
  ...
  template:
    ...
    spec:
       ...
       containers:
        - name: cert-manager-controller
          image: "quay.io/jetstack/cert-manager-controller:v1.11.0"
          ...
          args:
          - --cluster-resource-namespace=$(POD_NAMESPACE)
          ...
        ...

Likewise, setting the global.logLevel value to 0 in a values.yaml file gives the same result.

helm template cert-manager jetstack/cert-manager \
  --version v1.11.0 \
  --values global-loglevel.yaml \
  --dry-run --output-dir helm
## global-loglevel.yaml
global:
  logLevel: 0

Anything else we need to know?:
Setting the 0 value in a values.yaml as a quoted string will render the arg in the container spec. Also, setting any other value (as a string or integer) will render the arg in the container spec.

## global-loglevel.yaml
global:
  logLevel: "0"
helm template cert-manager jetstack/cert-manager \
  --version v1.11.0 \
  --values global-loglevel.yaml \
  --dry-run --output-dir helm
---
# Source: cert-manager/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
...
spec:
  ...
  template:
    ...
    spec:
       ...
       containers:
        - name: cert-manager-controller
          image: "quay.io/jetstack/cert-manager-controller:v1.11.0"
          ...
          args:
          - --v=0
          - --cluster-resource-namespace=$(POD_NAMESPACE)
          ...
        ...

Unfortunately, quoting the 0 like --set global.logLevel="0" doesn't seem to work either.

Environment details::

  • Kubernetes version: 1.24.7
  • Cloud-provider/provisioner: kind
  • cert-manager version: v1.11.0 (also tested on v1.10.1)
  • Install method: helm v3.11.1

/kind bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions