fix: prevent preparing chart for disabled releases (#1210)

* fix: prevent preparing chart for disabled releases

Previously, PrepareCharts does not filter any releases whose condition
is disabled with no selectors.

Prevent following things from
- using any unnecessary computing resources for disabled charts
- throwing any error from wrong configurations for disabled charts

Signed-off-by: Seonghoi lee <mighty1231@gmail.com>

* fix: working for integration test about list and build

Some tests require that PrepareCharts without any selector
may not add any labels on the release.

make markExcludedReleases do not add any label without any selectors

Signed-off-by: Seonghoi lee <mighty1231@gmail.com>

* fix: prevent resolved chart version loss

State loss the resolved chart version info from st.Releases
when st.GetSelectedReleases() be called

update st.Releases after st.GetSelectedReleases() in prepareCharts

Signed-off-by: Seonghoi lee <mighty1231@gmail.com>

* fix: preserve resolved version from resolveDeps

In PrepareCharts, the version, resolved from resolveDeps,
is removed after invoking GetSelectedReleases.

Do updateDeps at the first before GetSelectedReleases call

Signed-off-by: Seonghoi lee <mighty1231@gmail.com>

---------

Signed-off-by: Seonghoi lee <mighty1231@gmail.com>
This commit is contained in:
Seonghoi Lee
2024-01-02 08:56:07 +08:00
committed by GitHub
parent 589eb19b8a
commit 4871a92b8c
3 changed files with 38 additions and 27 deletions
@@ -1,3 +1,5 @@
mysecret: MYSECRET
raw2:
enabled: false
release-disabled:
enabled: false
@@ -54,3 +54,20 @@ releases:
values:
- mysecret: {{ .Environment.Values.mysecret }}
- values.yaml
- name: release-disabled
chart: ../../../charts/helmx
namespace: release-disabled
condition: release-disabled.enabled
values:
- values-not-found.yaml
jsonPatches:
- target:
version: v1
kind: ConfigMap
name: release-name
patch:
- op: add
path: /metadata/annotations
value:
foo: bar