Skip to content
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

[release-4.8] WINC-650: [wmco] Apply worker role to BYOH Nodes #597

Conversation

openshift-cherrypick-robot

This is an automated cherry-pick of #541

/assign mansikulkarni96

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.
@mansikulkarni96
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 13, 2021
@aravindhp
Copy link
Contributor

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 13, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aravindhp, openshift-cherrypick-robot

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 13, 2021
@openshift-ci openshift-ci bot merged commit d2a8111 into openshift:release-4.8 Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants