helmfile/pkg/app
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/testapply_2/deduplicate_by_--selector 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
version feat: Persist Helmfile version in helmfile.lock for version compatibility check (#1016) 2019-12-11 09:19:18 +09:00
app.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
app_apply_nokubectx_test.go fix: spec.KubeContext does not fallback to HelmDefaults.KubeContext (#1789) 2021-04-24 16:02:58 +09:00
app_apply_test.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
app_sync_test.go fix: spec.KubeContext does not fallback to HelmDefaults.KubeContext (#1789) 2021-04-24 16:02:58 +09:00
app_test.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
ask.go feat: helmfile as a go library (#639) 2019-06-04 09:12:00 +09:00
config.go Fix destory, delete, and test to work with chartify on local chart with dependencies that are not yet downloaded (#1801) 2021-04-24 20:50:16 +09:00
constants.go feat: "bases" for easier layerina 2019-05-13 21:48:00 +09:00
constants_test.go Bump golang to v1.14.2 (#1132) 2020-04-21 09:06:29 +09:00
context.go Fix repo sync to work on repos duplicated between helm v2 and v3 (#1816) 2021-04-30 09:27:23 +09:00
desired_state_file_loader.go Fix defaulting and overriding kubeContext (#1814) 2021-05-01 12:42:29 +09:00
destroy_nokubectx_test.go fix: spec.KubeContext does not fallback to HelmDefaults.KubeContext (#1789) 2021-04-24 16:02:58 +09:00
destroy_test.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
diff_nokubectx_test.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
diff_test.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
errors.go feat: Opt-out dep-builds and repo-updates (#463) 2019-02-04 12:07:25 +09:00
formatters.go Add chart & version to list cmd output (#1731) 2021-03-23 16:29:48 +09:00
load_opts.go Fix and enhancement to repository update (#1383) 2020-07-28 10:17:43 +09:00
mocks_test.go feat: added in oci repository flag and added helm methods to pull and export charts (#1629) 2021-01-28 09:02:00 +09:00
run.go Respect release filter in lint and status (#1672) 2021-04-06 15:47:29 +09:00
snapshot_test.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
two_pass_renderer.go feat: Allow overriding chart via flag (#1751) 2021-04-06 13:20:41 +09:00
two_pass_renderer_test.go Add the ability to load a remote environment values file (#1296) 2020-06-11 10:04:01 +09:00