helmfile/pkg
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
..
app 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
argparser Bump sprig to v3.1.0 and mergo 3.11 (#1456) 2020-09-04 09:58:54 +09:00
environment Fix: populate .Values regardless of prestate success (#1202) 2020-04-17 09:18:01 +09:00
event Fix some hook log not honoring log level (#1769) 2021-04-10 16:50:42 +09:00
exectest Fix delete on release of `uninstalling` status (#1786) 2021-04-21 09:39:14 +09:00
helmexec Add helm-secrets-encrypted values template file (#1701) 2021-04-06 14:20:42 +09:00
maputil Add indexed key support to --state-values-set (#1042) 2019-12-17 07:31:42 +09:00
plugins feat(template): added secret template function (#1221) 2020-04-25 21:10:02 +09:00
remote Fix error on concurrent go-getter on same URL (#1669) 2021-02-05 09:02:21 +09:00
state 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
testhelper Fix the logic of helmfile deps and add tests. (#1588) 2020-11-19 09:29:59 +09:00
tmpl feat: Helmfile renders *.yaml.gotmpl in a K8s manifests/kustomization directory (#1745) 2021-04-06 14:22:34 +09:00