-
Notifications
You must be signed in to change notification settings - Fork 66
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
[community-4.8] WINC-650: [wmco] Apply worker role to BYOH Nodes #557
[community-4.8] WINC-650: [wmco] Apply worker role to BYOH Nodes #557
Conversation
Moves everything that was present in the annotations package into the metadata package. This is being done as we will need to use the functions present in the annotations package for labels as well, and it makes more sense to generalize the functions considering the similarities between annotations and labels.
Refactors the patch creation in order to enable better unit testing. Specifically, this commit makes it so that metadata.generatePatch no longer returns the marshalled patches, but instead returns the slice of patches it generated, allowing those to be marshalled at the call sites, metadata.GenerateAddPatch() and metadata.GenerateRemovePatch(). This commit is important for two reasons. Firstly, using assert.elementsMatch to test that a byte slice is correct does not seem like the right thing to do. This seems as if it just tests that the chars are all the same, so the patchdata could be made out of order and this unit test would not catch that. Secondly this allows for more complex testing, which will be required in a future commit where generatePatch() handles both annotations and labels. Additionally, since the tests had to be changed, I changed one case to exercise the escaping functionality, something that was being missed by the tests.
Extends the annotation patch creation functions to allow for labels as well.
The machine-api-controller does this for Nodes associated with Machines, this needed to be done for BYOH Nodes as well.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: openshift-cherrypick-robot, sebsoto 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 |
/retest |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
This is an automated cherry-pick of #541
/assign sebsoto