Skip to content
This repository has been archived by the owner on Apr 22, 2020. It is now read-only.

Release Filter using Prefix #93

Open
otaviof opened this issue Sep 5, 2017 · 2 comments
Open

Release Filter using Prefix #93

otaviof opened this issue Sep 5, 2017 · 2 comments

Comments

@otaviof
Copy link
Collaborator

otaviof commented Sep 5, 2017

Considering that we have two namespaces, one test and another acceptance, and a release named nginx with prefix prereq is being deployed on both environments. My expected outcome would be that both namespaces would get prereq-nginx installed, but what happens is that it get removed from the first namespace (what is not the target of Landscaper's current run).

On debugging logging we can observe:

time="2017-09-05T21:25:40Z" level=debug msg=listHelmReleases 
2017/09/05 21:25:40 warning: destination for annotations is a table. Ignoring non-table value <nil>
[snip]
time="2017-09-05T21:25:40Z" level=debug msg="Reading secrets for component" component=prereq-nginx namespace=acceptance 
time="2017-09-05T21:25:40Z" level=debug msg="No secrets found for component" component=prereq-nginx namespace=acceptance
[snip]
time="2017-09-05T21:25:40Z" level=debug msg="Reading secrets for component" component=prereq-test-nginx namespace=test
time="2017-09-05T21:25:41Z" level=debug msg="No secrets found for component" component=prereq-test-nginx namespace=test 
[snip]
time="2017-09-05T21:25:41Z" level=info msg="Retrieved Releases (Components)" landscapedComponents=18 totalReleases=18 
time="2017-09-05T21:25:41Z" level=info msg="Apply desired state" create=0 delete=5 update=0 
[snip]
time="2017-09-05T21:25:41Z" level=info msg="Delete: prereq-test-nginx"

At state_provider.go +271 we have:

	filter := helm.ReleaseListFilter(fmt.Sprintf("^%s.+", cp.releaseNamePrefix))

So it only filters by the regexp applied on prefix, on which the example here it matches on two different namespaces, then would be possible to exclude releases that are not currently on target namespace? I think the desired behavior is to only "delete" the release if it's deployed on the same (target) namespace, and on this example both prereq-nginx would be kept.

@ImMiracleMax
Copy link

We ran into the same problem, we end up using --disable delete all over the place.

@johnhofman
Copy link
Contributor

We include the environment in our prefix, but that is getting unwieldy. Another solution is to use a separate tiller namespace per environment, we are planning to move to this because we can also keep the configmaps and tiller rbac separate.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants