You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using an environment config selector with mode: Multiple it’s possible for two environment configs to be selected that contain the same key with different values. When the environment configs are merged, one of the values ends up being overwritten with no warning log/event emitted.
I think it would be useful to composition developers/platform engineers to see some sort of warning when duplicate keys are merged into one map when using mode: Multiple environmentconfig selector.
How could Crossplane help solve your problem?
Add a warning log/event when duplicate keys are found during environmentconfig merge for mode: Multiple.
The text was updated successfully, but these errors were encountered:
@phisco Hmmm, I might be missing something here -- but this issue isn't really concerned with the order in which the env configs are merged.
This issue is geared towards emitting an error/warning message when a composition selects multiple EnvironmentConfigs via a label, and those env configs have duplicate keys. Since it's a single label selector, there's no way to define the order of the env configs that match the label selector.
If two env configs that contain the same key (but different value) are being merged (via a single label selector), Crossplane will silently merge the maps and overwrite the previous key's value with the key value in the map being merged. This could cause undesired behavior if the platform engineer / composition developer is not aware of it. A simple warning/event would help reduce the possibility of this undesired behavior going unnoticed.
For example:
Imagine a platform team has developed a composition with this env config selector:
When Crossplane merges these maps it isn't immediately clear which value the final map will have for data key. A simple check in the merge step could bring this silent overwrite to the composition developer's attention and hopefully save some debugging time. That's the idea I had in mind for creating this enhancement issue.
Hope that clarifies, and please let me know if I'm still missing something.
What problem are you facing?
When using an environment config selector with
mode: Multiple
it’s possible for two environment configs to be selected that contain the same key with different values. When the environment configs are merged, one of the values ends up being overwritten with no warning log/event emitted.I think it would be useful to composition developers/platform engineers to see some sort of warning when duplicate keys are merged into one map when using
mode: Multiple
environmentconfig selector.How could Crossplane help solve your problem?
Add a warning log/event when duplicate keys are found during environmentconfig merge for
mode: Multiple
.The text was updated successfully, but these errors were encountered: