mirror of
https://github.com/helmfile/helmfile.git
synced 2026-10-05 19:02:26 +02:00
```yaml
environments:
default:
missingFileHandler: Warn
values:
- path/to/values.yaml
secrets:
- path/to/secrets.yaml
```
`missingFileHandler` set to `Warn`, `Info`, or `Debug` results in helmfile NOT stop when `path/to/values.yaml` or `path/to/secrets.yaml` is missing.
Resolves #548
While implementing the above feature, I also found a bug that has been causing #559. This also fixes that.
To verify it is actually fixed, create an example helmfile.yaml that looks like the below, and run `helmfile diff`:
```
$ cat helmfile.yaml
environments:
default:
secrets:
- env-secrets.yaml
releases:
- name: myapp
chart: nginx
namespace: default
secrets: [secrets.yaml] # Notice this file does not exist
values:
- ingress:
enabled: true
$ helmfile diff
could not deduce `environment:` block, configuring only .Environment.Name. error: failed to read helmfile.yaml.part.0: environment values file matching "env-secrets.yaml" does not exist
in ./helmfile.yaml: failed to read helmfile.yaml: environment values file matching "env-secrets.yaml" does not exist
```
Fixes #559
16 lines
578 B
Go
16 lines
578 B
Go
package state
|
|
|
|
type EnvironmentSpec struct {
|
|
Values []string `yaml:"values"`
|
|
Secrets []string `yaml:"secrets"`
|
|
|
|
// MissingFileHandler instructs helmfile to fail when unable to find a environment values file listed
|
|
// under `environments.NAME.values`.
|
|
//
|
|
// Possible values are "Error", "Warn", "Info", "Debug". The default is "Error".
|
|
//
|
|
// Use "Warn", "Info", or "Debug" if you want helmfile to not fail when a values file is missing, while just leaving
|
|
// a message about the missing file at the log-level.
|
|
MissingFileHandler *string `yaml:"missingFileHandler"`
|
|
}
|