landscaper icon indicating copy to clipboard operation
landscaper copied to clipboard

Feature Request: per-namespace apply

Open james-masson opened this issue 7 years ago • 4 comments

I noticed that landscaper supports the --namespace option for setting the namespace a helm chart is deployed to. To be clear - this is not what I'm after....

I would like landscaper to be able to do diffs based on a namespace.

eg.

namespace-foo>
                             deployment1.yaml
                             deployment2.yaml
namespace-bar>
                             deployment3.yaml
                             deployment4.yaml

currently, if landscaper knows about deployments1-4, there's no way to only consider/diff/apply changes to a particular namespace only.

eg. I change all of the deployments, but I only want to consider "namespace-bar" changes for landscaping right now.

I could then do

landscaper apply --only-namespace namespace-bar *.yaml

and only changes to deployment3-4 would be applied

My use case is I have multiple teams, each working in different namespaces. With landscaper currently, a mistake by one team can block deployments in another team. Applying by namespace would solve this.

thanks

James M

james-masson avatar Feb 23 '18 11:02 james-masson

Hi James,

How are you organising your landscape component files? We had a similar challenge with multiple namespaces in our repository, so now we use a directory per namespace. Then our release manager landscapes each namespace independently when changes are made to that directory.

Cheers, John.

johnhofman avatar Feb 27 '18 07:02 johnhofman

I do have a directory per namespace. However, landscaper tries to remove all deployments not in that directory/namespace if I only apply on a subset.

james-masson avatar Feb 28 '18 09:02 james-masson

You can use the --disable=delete flag. This will prevent deleting what is not in your subset.

royjs avatar Feb 28 '18 17:02 royjs

Perhaps, but that's a manual workaround at best - not suitable for a CI process.

james-masson avatar Mar 01 '18 10:03 james-masson