-
Notifications
You must be signed in to change notification settings - Fork 32
[4.20] OCPBUGS-60083: Fix strategic merge #686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release-4.20
Are you sure you want to change the base?
Conversation
This PR fixes fundamental issue with the previous patch nmstate#1357 that was supposed to introduce strategic merge. Because we operate on `unstructured.Unstructured` objects, `StrategicMergeFrom` was not running correctly as it cannot detect the type of the object. To fix this issue we introduce a conversion to the typed object based on its GroupVersionKind. That way, strategic merge operates on an object with a well-defined type. For any cases where we cannot convert untyped object, we will fallback to the regular merge strategy. Additionally, we are introducing a function merging metadata for objects type `Namespace`. This is because those do not have a proper merge strategy defined for their metadata. As a result, strategic merge which involves labels and annotations overrides those as a whole map. Having such a function allows us to properly merge labels and annotations. Signed-off-by: Mat Kowalski <[email protected]>
|
/hold |
|
@mkowalski: This pull request references Jira Issue OCPBUGS-60083, which is valid. The bug has been moved to the POST state. 7 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mkowalski The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test e2e-operator-ovn-ipv4 |
|
@mkowalski: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/hold The reason is that this code diverges a lot from what we have on master/4.21; I do not want to merge it unless really necessary. Please keep it open with hold in case there is a critical escalation that is affected by this code. I do not expect one, but you never know. |
This PR fixes fundamental issue with the previous patch nmstate#1357 that was supposed to introduce strategic merge.
Because we operate on
unstructured.Unstructuredobjects,StrategicMergeFromwas not running correctly as it cannot detect the type of the object. To fix this issue we introduce a conversion to the typed object based on its GroupVersionKind. That way, strategic merge operates on an object with a well-defined type. For any cases where we cannot convert untyped object, we will fallback to the regular merge strategy.Additionally, we are introducing a function merging metadata for objects type
Namespace. This is because those do not have a proper merge strategy defined for their metadata. As a result, strategic merge which involves labels and annotations overrides those as a whole map. Having such a function allows us to properly merge labels and annotations.