Coder Social home page Coder Social logo

Comments (4)

bjw-s avatar bjw-s commented on June 5, 2024

Some additional testing seems to have it pinpointed to the use of sprig's merge function within the library chart that is used by the mentioned Jackett chart. While trying to isolate the issue, i noticed the following:

Given the following simple configmap template:

apiVersion: v1
kind: ConfigMap
metadata:
  name: test
data:
  # WORKS
  userValues: |-
    {{- $userValues := omit .Values "common" -}}
    {{- $userValues | toYaml | nindent 4 }}

  # WORKS
  defaultValues: |-
    {{- $defaultValues := get .Values "common" -}}
    {{- $defaultValues | toYaml | nindent 4 }}

  # ?EMPTY STRING?:
  mergedValues: |-
    {{- $mergedValues := merge $userValues $defaultValues -}}
    {{- $mergedValues | toYaml | nindent 4 }}

Renders the following output in flux v2 (notice how mergedValues is an empty string):

apiVersion: v1
data:
  defaultValues: |-
    service:
      additionalPorts: []
      additionalServices: []
      annotations: {}
      enabled: true
      labels: {}
      port:
        name: http
        port: ""
        protocol: TCP
        targetPort: http
      type: ClusterIP
    strategy:
      type: RollingUpdate
  mergedValues: ""
  userValues: |-
    service:
      port:
        port: 9117
    strategy:
      type: Recreate

When running helm template or helm install (and also in flux v1) this output is rendered as expected (notice how mergedValues is filled):

apiVersion: v1
data:
  defaultValues: |-
    service:
      additionalPorts: []
      additionalServices: []
      annotations: {}
      enabled: true
      labels: {}
      port:
        name: http
        port: ""
        protocol: TCP
        targetPort: http
      type: ClusterIP
    strategy:
      type: RollingUpdate
  userValues: |-
    service:
      port:
        port: 9117
    strategy:
      type: Recreate
  mergedValues: |-
    service:
      additionalPorts: []
      additionalServices: []
      annotations: {}
      enabled: true
      labels: {}
      port:
        name: http
        port: 9117
        protocol: TCP
        targetPort: http
      type: ClusterIP
    strategy:
      type: Recreate
kind: ConfigMap

from helm-controller.

bjw-s avatar bjw-s commented on June 5, 2024

Seems to be that the type validation in Flux v2 is somehow stricter than before (and in helm template). There was a value set as string in one of the values.yaml, whereas the value override in the chart was an int. That caused the following error:

{"level":"debug","ts":"2020-11-12T16:03:46.534Z","logger":"controller-runtime.manager.events","msg":"Normal","object":{"kind":"HelmRelease","namespace":"test","name":"test","uid":"df207251-c73f-4d61-befb-7d596cdb0ed3","apiVersion":"helm.toolkit.fluxcd.io/v2beta1","resourceVersion":"138550"},"reason":"error","message":"Helm install failed: template: test/templates/configmap.yaml:19:25: executing "test/templates/configmap.yaml" at <mustMerge $userValues $defaultValues>: error calling mustMerge: cannot append two different types (string, float64)"}

from helm-controller.

onedr0p avatar onedr0p commented on June 5, 2024

This was an issue with our chart that we corrected, but flux2 is the only one that has an issue.

I'll close the issue unless other people report in having a similar issue.

from helm-controller.

seaneagan avatar seaneagan commented on June 5, 2024

Likely the same root cause as #152

from helm-controller.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.