kots icon indicating copy to clipboard operation
kots copied to clipboard

HelmChart kots kind should auto detect Helm version

Open aj-jester opened this issue 6 years ago • 3 comments

I was able to repro the Helm v2 vs. v3 issue. Below are two identical charts, only difference is the dependencies in v2 is in a separate requirements.yaml while the v3 one is in Chart.yaml, no requirements.yaml. What’s weird is in v3, even when values.yaml (inside the Helm Chart) is hardcoded to false the subchart still gets deployed, but when I do helm template --debug . it doesn’t show the resources from the subchart, but when I deploy it via KOTS it seems to be totally ignore and the subchart is deployed.

Both the V2 and V3 charts are in the ZIP file.

toocoolforskool-0.0.1_helm.zip

apiVersion: kots.io/v1beta1
kind: HelmChart
metadata:
  name: toocoolforskool
spec:
  chart:
    name: toocoolforskool
    chartVersion: 0.0.1
  values:
    favorite:
      drink: badam

  optionalValues:
    - when: '{{repl ConfigOptionEquals "toocool_sub" "1" }}'
      values:
        toocool_sub:
          enabled: true

aj-jester avatar Jul 27 '20 23:07 aj-jester

@aj-jester could you try this with helmVersion set to v3 in this file? By default, KOTS renders with the v2 helm library, and we require opting into the v3 rendering methods today. https://kots.io/reference/v1beta1/helmchart/

marccampbell avatar Jul 28 '20 16:07 marccampbell

ah @marccampbell that did work, although i encountered this error: https://github.com/replicatedhq/kots/issues/881 that i worked around temporarily by splitting every single resource into its own file. That's a bit tedious and verbose, but for now its a fine workaround. Would prefer to go back to the multiple resource setup though

Also, would it be possible to throw an error when using a helm v3 chart with helm v2 version here instead of silently failing? You should be able to tell what chart type it is by the apiVersion field in Chart.yaml

glentakahashi avatar Jul 29 '20 02:07 glentakahashi

This is now available in v1.43.0 https://kots.io/release-notes/#1430

AmberAlston avatar May 29 '21 00:05 AmberAlston