Helmfile: 'needs:' directive in the dependent release does not respect the 'installed: false' of the other release

Created on 6 Dec 2019  路  10Comments  路  Source: roboll/helmfile

releases:
- name: test-1
  chart: test-1
  installed: false
  namespace: namespace-1

- name: test-2
  chart: test-2
  namespace: namespace-2
  needs: [ namespace-1/test-1 ]

In this case, the release test-2 shouldn't be installed due to installed: false in release test-1.

I'm using helm v3.0.0 and helmfile v0.94.1.

feature request

All 10 comments

Thanks for the feature request!

Would you mind taking a look into https://github.com/roboll/helmfile/pull/914#issuecomment-563049327?

Actually, we rely on the current behaviour). The example is pretty similar to mumoshu's in #914.

@carlosmkb What was your original use-case, btw?

If you wanted to enable only part of releases defined in your helmfile.yaml, you'd probably prefer helmfile -l somekey=somevalue.

my use case is when I disabled a release A (installed: false) and a release B depends on A but it is not disabled (installed: true), the helm apply should trigger an error, because the state file is saying that the release B should be installed but depends on the release A that will not be installed.

@carlosmkb Thx. That does make sense from one view.

But how would to address my use-case https://github.com/roboll/helmfile/pull/914#issuecomment-563049327 with your proposed change?

Hey @carlosmkb and everyone - Should we change needs to after, and make needs require installed: true to succeed?

That said, @carlosmkb's example should just work as he has expected:

releases:
- name: test-1
  chart: test-1
  installed: false
  namespace: namespace-1

- name: test-2
  chart: test-2
  namespace: namespace-2
  needs: [ namespace-1/test-1 ]

And for my usecase as I'm only interested in the order of installation, use after like this:

releases:
- name: cluster-logging
  chart: charts/fluent-bit
  installedTemplate: {{ .Values.clusterLogging.enabled}}

- name: service-mesh
  chart: charts/istio
  after: [ cluster-logging ]
  installedTemplate: {{ .Values.serviceMesh.enabled}}

- name: myapp
  chart: charts/myapp
  after: [service-mesh, cluster-logging]

Sounds good!

hi @mumoshu sounds good to me too, but the needs directive still guarantees the order of installation right?

@carlosmkb Exactly.

I'll start by adding after as an alias to needs. Later I'll change needs behavior as proposed above.

Was this page helpful?
0 / 5 - 0 ratings