Closed
Description
When running helmfile test
on a helmfile with conditional releases, releases with condition: false
are still tested.
Example:
repositories:
- name: stable
url: https://kubernetes-charts.storage.googleapis.com
environments:
default:
values:
- two:
enabled: false
releases:
- name: one
namespace: first
chart: stable/wordpress
- name: two
namespace: second
chart: stable/wordpress
condition: two.enabled
Running helmfile test
yields:
$ helmfile test
Testing two
Testing one
in ./helmfile.yaml: 2 errors:
err 0: release "two" failed: command "/usr/local/bin/helm" exited with non-zero status:
PATH:
/usr/local/bin/helm
ARGS:
0: helm (4 bytes)
1: test (4 bytes)
2: two (3 bytes)
3: --namespace (11 bytes)
4: second (6 bytes)
ERROR:
exit status 1
EXIT STATUS
1
STDERR:
Error: release: not found
COMBINED OUTPUT:
Error: release: not found
err 1: release "one" failed: command "/usr/local/bin/helm" exited with non-zero status:
PATH:
/usr/local/bin/helm
ARGS:
0: helm (4 bytes)
1: test (4 bytes)
2: one (3 bytes)
3: --namespace (11 bytes)
4: first (5 bytes)
ERROR:
exit status 1
EXIT STATUS
1
STDERR:
Error: release: not found
COMBINED OUTPUT:
Error: release: not found
I believe the error is somewhere here:
helmfile/pkg/state/state_run.go
Line 58 in 14e2b9e
I suggest evaluating the condition or maybe enhance the Desired
function of releases as they are already evaluated here
Line 1500 in 14e2b9e
Relevant Metadata
Helmfile version
$ helmfile version
helmfile version v0.129.3
Helm version & Plugins
$ helm version
version.BuildInfo{Version:"v3.3.1", GitCommit:"249e5215cde0c3fa72e27eb7a30e8d55c9696144", GitTreeState:"dirty", GoVersion:"go1.15"}
$ helm plugin list
NAME VERSION DESCRIPTION
diff 3.1.3 Preview helm upgrade changes as a diff
helm-git 0.7.0 Get non-packaged Charts directly from Git.
x 0.8.1 Turn Kubernetes manifests and Kustomization into Helm Release
go version
$ go version
go version go1.15.2 darwin/amd64
mac os version
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.15.6
BuildVersion: 19G2021