update provider validation to allow a list of structs or a single struct #1
+9
−4
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.
This validation allows the use of a list of structs or a single struct for provider definition. This means we can now define multiple instances of the same provider using standard Cue syntax, with no risk E.G.:
Previously in my testing defining multiple instances of the same provider would cause the two providers to coalesce into a single instance if the subscription ID was the same and no alias is provided on the other instance. In our use case subscription 1 is derived from user input. Subscription 2 is a statically defined provider used to read data from some pre-defined azure resources. Subscription 1 and Subscription 2 may, in theory be the same subscription but must remain separate providers due to alias usage. This change preserves the said configuration of multiple provider instances.
Without the ability to use a list of structs for providers in the event that "USER INPUT SUBSCRIPTION" is equal to "SUBSCRIPTION" you end up rendering the above code down to this:
With my proposed changes it becomes: