fix: workspaces validation with multiple files #839
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When running
deck sync
with multiple state files, either by passing multiple-s
flags(e.g.
-s foo.yaml -s bar.yaml
) or by passing a folder (e.g.-s ./statefiles
), decK merges the whole configuration from all files and it fails the content validation if different_workspace
entries are found. While this is good and expected by design, decK also fails in the following case:The error from decK would be the following:
The reason why decK is failing is because it's adding an empty workspace to the array used for validation because the
foo.yaml
state file is missing the_workspace
entry.This commit makes sure that the "emtpy workspace" is not considered at workspace validation time.