fabrikate icon indicating copy to clipboard operation
fabrikate copied to clipboard

Handle fab set where 2+ matches exist in subpaths

Open dtzar opened this issue 6 years ago • 1 comments

If there is more than one tag in a subpath, fab set should detect this, fail and display useful information so the user can fix the command.

For instance imageTag is present for multiple charts under the staging environment with a command like this: fab set --environment staging imageTag=foo:121

Fabrikate might fail and return something like this back in an error message: imageTag exists in multiple directories chart1.app1.imageTag chart2.app2.imageTag. Specify a set path which matches only one item.

This command would succeed: fab set --environment staging app1.imageTag=foo:121 app2.imageTag=bar:343

dtzar avatar Mar 21 '19 18:03 dtzar

fab set only applies its action to the current config directory, and in your case, the environment staging - so in this case, it would emit/set the following config:

config/staging.yaml: 

config:
  imageTag: "foo:121"

So in using fab you currently express at what level in the hierarchy you want the config to be applied in by executing it in that directory.

timfpark avatar Mar 21 '19 23:03 timfpark