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

allow to instruct landscaper to reject an empty landscape #59

Closed
wants to merge 1 commit into from

Conversation

linki
Copy link
Contributor

@linki linki commented May 10, 2017

This adds a flag reject-empty-landscape that doesn't apply a landscape when the desired list of components is empty, i.e. would wipe everything out.

It solves the gotcha mentioned here where the initial loop iteration applies an empty landscape because the git repo wasn't synced yet.

This can also be used to protect a user using landscaper on the command line when she accidentally picks the wrong landscape source folder.

Let me know what you think and if you'd like to have this feature. I know that landscaper is mainly used from the CLI where this flag is less useful and may just blow up the flags.

@rollulus
Copy link
Collaborator

Thanks, @linki. Makes sense. Two things:

  • We've gone through some quite intense refactoring since your commit, and we've got rid of having Environment everywhere. I think the resulting code is way cleaner, but it makes your code fail to build;
  • Another thought I had: refuse to apply empty landscapes by default, and provide a --force flag that removes any safety net. That same --force can also then be used to fix Deal with non-landscaper-managed conflicting components in a more elegant way #22, where the default would be 'don't overwrite a non-landscaper secret' unless --force. What do you think?

@linki
Copy link
Contributor Author

linki commented May 11, 2017

We've gone through some quite intense refactoring since your commit, and we've got rid of having Environment everywhere. I think the resulting code is way cleaner, but it makes your code fail to build;

I'm happy to look into this and apply the fixes.

Another thought I had: refuse to apply empty landscapes by default, and provide a --force flag that removes any safety net. That same --force can also then be used to fix #22, where the default would be 'don't overwrite a non-landscaper secret' unless --force. What do you think?

Sounds good to me! However, I fear that using --force becomes the default way how people will run landscaper then, which would defeat the purpose.

@linki
Copy link
Contributor Author

linki commented May 15, 2017

On Hold for now

@linki linki closed this May 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants