helmfile/pkg/state
Yusuke Kuoka 08db073958
Fix broken selector and DAG calculation logic after --{include,skip}-needs addition with correct Release IDs (#1823)
#1772 broke `--selector` with `needs` in many ways.

The two biggest problems I've encountered were:

- duplicate releases even if you've provided a proper `selector` to deduplicate
- sync/deletion ordering broken when you have `needs`

For the first issue, we had to update `getSelectedReleases` function to also calculate the "selected releases and releases needed by the selected releases", and use that to calculate the DAG. That should have been done in #1772.

The latter started happening after I've fixed the first issue. The source of the issue was that `needs` turned out to be ambiguous in a few cases.

Previously, `needs: ["foo/bar"]` had two meanings. One for "needs release bar in kubecontext foo", another for "needs release bar in namespace foo".

Moreover, `needs: ["foo/bar/baz"]` had three meanings.

- `needs release baz in tiller namespace foo and namespace baz`
- `needs release baz in namespace bar in kubecontext foo`
- `needs release baz in tiller namespace bar in kubecontext foo`.

Especially, the first meaning doesn't make sense at all. Helm 2 solely use tillerNamespace for namespacing the release and Helm 3 uses namespace for that.

This fix sorts all the bugs and issues I've found so far around that, by changing the meanings of the above two examples as follows:

- `foo/bar` means `namespace=foo,name=bar` for Helm 3 and `tillerNamespace=foo,name=bar` for Helm 2
  - `needs release bar in kubecontext foo` is now `foo//bar`. Notice the extra `/` between `foo` and `bar`.
- `foo/bar/baz` means `kubecontext=foo,namespace=bar,name=baz` for Helm 3 and `kubecontext=foo,tillerNamespace=bar,name=baz` in Helm 2

Fixes #1818
2021-05-01 21:59:25 +09:00
..
testdata Add regression tests for environment values merge (#1170) 2020-04-04 14:27:29 +09:00
chart_dependency.go Improve error message on deps resolution error (#1727) 2021-03-23 16:44:59 +09:00
create.go Fix/secrets ordering (#1726) 2021-03-23 18:00:57 +09:00
create_test.go Fix the logic of helmfile deps and add tests. (#1588) 2020-11-19 09:29:59 +09:00
environment.go Add support for kubeContext in environments (#1675) 2021-03-23 18:06:53 +09:00
envvals_loader.go Add the ability to load a remote environment values file (#1296) 2020-06-11 10:04:01 +09:00
envvals_loader_test.go Add the ability to load a remote environment values file (#1296) 2020-06-11 10:04:01 +09:00
helmx.go Fix --set and --set-file flags are not passed to chartify (#1803) 2021-04-24 22:27:53 +09:00
release.go feat: `helmfile build --embed-values` to embed release values and secrets into the output (#1436) 2020-08-29 13:18:17 +09:00
release_error.go Fix misleading `helmfile diff` output (#1174) 2020-04-04 17:39:20 +09:00
release_filters.go Treat selector with multiple conditions an AND (#1478) 2020-09-15 09:56:05 +09:00
selector_test.go Fix concurrent-map-iteration-and-write errors while running release hooks (#1534) 2020-10-13 14:49:01 +09:00
state.go Fix broken selector and DAG calculation logic after --{include,skip}-needs addition with correct Release IDs (#1823) 2021-05-01 21:59:25 +09:00
state_exec_tmpl.go Fix defaulting and overriding kubeContext (#1814) 2021-05-01 12:42:29 +09:00
state_exec_tmpl_test.go Fix concurrent-map-iteration-and-write errors while running release hooks (#1534) 2020-10-13 14:49:01 +09:00
state_gogetter_test.go Fix error on concurrent go-getter on same URL (#1669) 2021-02-05 09:02:21 +09:00
state_run.go Fix broken selector and DAG calculation logic after --{include,skip}-needs addition with correct Release IDs (#1823) 2021-05-01 21:59:25 +09:00
state_test.go Fix delete on release of `uninstalling` status (#1786) 2021-04-21 09:39:14 +09:00
storage.go chore: tidy up pkgs (#636) 2019-06-01 13:36:05 +09:00
temp.go feat: Stabilize helmfile-diff output (#1622) 2020-12-15 10:24:27 +09:00
temp_rand.go feat: Stabilize helmfile-diff output (#1622) 2020-12-15 10:24:27 +09:00
temp_test.go Add helmfile-fetch command to downloading and generating charts (#1734) 2021-03-30 16:26:31 +09:00
types.go Fix defaulting and overriding kubeContext (#1814) 2021-05-01 12:42:29 +09:00
util.go Add support for ChartCenter (#1492) 2020-09-21 15:31:24 +09:00
util_test.go Add support for ChartCenter (#1492) 2020-09-21 15:31:24 +09:00