Closed herwigstuetz closed 1 year ago
Thanks again @herwigstuetz really appreciate the detailed description :100:
I'm OK with the caveat you've described so am happy to merge this now and can consider future solutions down the line if someone else is annoyed enough to solve it.
This change uses the attribute
name
ifx-kubernetes-patch-merge-key
is not the fullx-kubernetes-list-map-keys
to avoid data corruption.In particular:
Use
x-kubernetes-patch-merge-key
only if it agrees withx-kubernetes-list-map-keys
.If
x-kubernetes-patch-merge-key
doesn't agree withx-kubernetes-list-map-keys
, then use the propertyname
if it is present. This then matches the expectation wheregets transformed into
If
name
is not specified, this needs the workaround using__kubenix_list_merge_key_
inmergeValuesByKey
andsubmoduleWithMergeOf
to not change the original definition when specifying submodules as a list. Thengets transformed into
As of kubernetes 1.26, this affects
ContainerPort
,TopologySpreadConstraint
, andServicePort
wherex-kubernetes-patch-merge-key
is not equal tox-kubernetes-list-map-keys
.What doesn't work anymore is to do
which previously would have been transformed into
This is because in order to not discard ports with the same port number, but differing protocol, both would need to be encoded into the attribute name. And because I couldn't find a nice way to make this work, I chose to go with
name
as the merge key instead.closes hall/kubenix#13