vault-sync icon indicating copy to clipboard operation
vault-sync copied to clipboard

Make partial config handling more intuitive in sync command

Open fcantournet opened this issue 8 years ago • 0 comments

There are many config flags inherited from vaultctl for the sync command.

We can probably do a better Job at deducing the intent of the user from the actual input instead of relying on flag such as --skip-policies

A first step was to default --skip-policies to true when the -p flag isn't set. The logic behind it is that is we don't specify a policy directory to sync with, then we don't want to sync the policies.

We can extend that logic and generally make a difference between specifying an empty object e.g :

auths:   <- this is empty purposefully
backends:
 ... actual stuff ...

And the absence of the object alltogether : e.g:

backends:   <- no empty auths anywhere
 ... actual stuff...

We can generally use this heuristic to determine if we want to sync to empty or no sync at all.

This has to be done after we parsed all the config files, when we have a complete model.

fcantournet avatar Jan 19 '17 15:01 fcantournet