k0sproject / k0s

k0s - The Zero Friction Kubernetes
https://docs.k0sproject.io
Other
3.52k stars 355 forks source link

Allow nulls for helm values #4666

Closed makhov closed 3 months ago

makhov commented 3 months ago

Description

While we ​​clean up the values we convert null values to strings, which breaks some use cases. For instance:

apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
metadata:
  name: k0s
spec:
  extensions:
    helm:
      repositories:
      - name: aws-cloud-controller-manager
        url: https://kubernetes.github.io/cloud-provider-aws
      charts:
      - name: aws-cloud-controller-manager
        namespace: kube-system
        chartname: aws-cloud-controller-manager/aws-cloud-controller-manager
        version: "0.0.8"
        values: |
          nodeSelector: null
          args:
           - --v=2

causes the error:

* DaemonSet in version "v1" cannot be handled as a DaemonSet: json: cannot unmarshal string into Go struct field PodSpec.spec.template.spec.nodeSelector of type map[string]string

but it works perfectly with the helm cli.

Type of change

How Has This Been Tested?

Checklist:

k0s-bot commented 3 months ago

Successfully created backport PR for release-1.28:

k0s-bot commented 3 months ago

Successfully created backport PR for release-1.29:

k0s-bot commented 3 months ago

Successfully created backport PR for release-1.30: