helmfile icon indicating copy to clipboard operation
helmfile copied to clipboard

No way to ignore missing file for "values:" in helmfile

Open dene14 opened this issue 4 years ago • 6 comments
trafficstars

Hello @mumoshu !

I'm trying to set missingFileHandler: Warn for values: section of my helmfile:

bases:
- ../_lib/defaults.yaml.gotmpl
---
{{ readFile "../_lib/templates.yaml.gotmpl" }}
values:
- hosts: []
#  - name: "example"
#    ingressClass: "nginx"
#    port: "80"
#    targetPort: "80"
#    upstreamAddress: "192.168.0.1"
#    upstreamVhost: "www.example.com"
#    hostname: "www.example.com"
- ../../config/dbcc-external-services/{{ .Environment.Name }}/values.yaml.gotmpl        # Import env-specific list of hosts
releases:
- name: dbcc-external-services
  <<: *dbcc
  chart: incubator/raw
  namespace: miscellaneous-extra
  version: 0.2.3

I cannot use Environments: here, because it's complimentary helmfile included in a few entry-level helmfiles with different sets of environments... I've checked #548, but no solution provided for my case, or I'm doing something wrong? Any advice is much appreciated!

dene14 avatar Jan 18 '21 12:01 dene14

I'm also stuck with this.

Setting it under environments is ignored completely

environments:
  common:
    missingFileHandler: Warn

->

Adding repo grafana https://grafana.github.io/helm-charts
"grafana" has been added to your repositories

Building dependency release=loki-infrastructure, chart=charts/gcp-infrastructure
in ./monitoring.loki.yaml: failed processing release loki: values file matching "environments/common/loki.yaml" does not exist in "."

Though using it under releases works:

releases:
  - name: loki
    namespace: loki
    chart: grafana/loki
    missingFileHandler: Warn
    values:
      - defaults/loki.yaml
      - environments/{{ .Environment.Name }}/loki.yaml

->

Adding repo grafana https://grafana.github.io/helm-charts
"grafana" has been added to your repositories

Building dependency release=loki-infrastructure, chart=charts/gcp-infrastructure
skipping missing values file matching "environments/common/loki.yaml"
Comparing release=loki, chart=grafana/loki

I'm using the latest release:

helmfile version v0.137.0

muffl0n avatar Jan 19 '21 08:01 muffl0n

+1 for ability to either conditionally skip importing release values, or ignore selected missing value files.

rubenhak avatar Apr 28 '21 03:04 rubenhak

@rubenhak You can ignore release values load failures by setting releases[].missingFileHandler. Probably you meant anything else?

mumoshu avatar May 02 '21 01:05 mumoshu

Setting it under environments is ignored completely

@muffl0n Maybe you're trying to set releases' default missingFileHandler value? I thought it was possible thru helmDefaults.

environments.Name.missingFileHandler is for making some environment values file optional.

mumoshu avatar May 02 '21 01:05 mumoshu

@dene14 try to use information that I wrote at #2063

AssafKatz3 avatar Jan 25 '22 07:01 AssafKatz3

having the same problem with version v0.142.0 I would like to set missingFileHandler per environment so environments.<name>.missingFileHandler but this is completely ignored

setting missingFileHandler under helmDefaults produces:

failed to read helmfile.yaml: reading document at index 1: yaml: unmarshal errors:
  line 8: field missingFileHandler not found in type state.HelmSpec

alexandragroschner avatar Feb 21 '22 13:02 alexandragroschner