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

Bug 2034364: Use resource{apply,merge,read} functions provided by library-go #2833

Merged
merged 2 commits into from Dec 21, 2021

Conversation

mkenigs
Copy link
Contributor

@mkenigs mkenigs commented Nov 18, 2021

Borrowing from #829 which helps #819

We currently have code duplicated from library-go in ./lib, and this
commit uses some of the library-go functions instead and removes the
files that contained the duplicated code in
./lib/resource{apply,merge,read}.

Doing so requires adding events.Recorder as libgoRecorder to the
Operator struct.

Note that this does not remove all functions from lib; some lib
functions contain MCO specific logic or would not be trivial to move, so
doing so can be done at another time.

Unit testing these changes is not really possible since the newly used
functions are from outside the MCO repo, and the complexity of e2e
testing is not worth the effort at this time, since the library-go
functions should maintain current behavior. A more thorough test plan
might be necessary to move the rest of lib.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Nov 18, 2021

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 18, 2021
@mkenigs
Copy link
Contributor Author

mkenigs commented Nov 18, 2021

@kikisdeliveryservice how would I go about verifying this doesn't break anything? Looked at some of the functions in lib and there are definitely differences, but I don't know if they're important

@yuqi-zhang
Copy link
Contributor

This one is a bit harder to test since we never really had the full scope of unit testing for these libraries. We could attempt to add MCO specific field testing for this, though, just to make sure we don't break anything.

Two ways we could approach this:

  1. look at the old functions (e.g. what we are ensuring when updating the daemonsets, etc.) and attempt to mock changing those via unit tests
  2. do some manual testing by modifying fields in a live cluster

pkg/operator/sync_test.go Outdated Show resolved Hide resolved
pkg/operator/sync_test.go Outdated Show resolved Hide resolved
@mkenigs mkenigs marked this pull request as ready for review November 29, 2021 22:02
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 29, 2021
@kikisdeliveryservice kikisdeliveryservice changed the title Use resource{apply,merge,read} functions provided by library-go [WIP] Use resource{apply,merge,read} functions provided by library-go Nov 29, 2021
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 29, 2021
@kikisdeliveryservice
Copy link
Contributor

depends on: #2837

@mkenigs mkenigs force-pushed the use-library-go branch 4 times, most recently from 52cb262 to cd4437b Compare November 30, 2021 21:24
@mkenigs mkenigs changed the title [WIP] Use resource{apply,merge,read} functions provided by library-go Use resource{apply,merge,read} functions provided by library-go Nov 30, 2021
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 30, 2021
@mkenigs mkenigs force-pushed the use-library-go branch 2 times, most recently from 2a89f75 to fb4a508 Compare December 7, 2021 19:21
@kikisdeliveryservice
Copy link
Contributor

/test images

@kikisdeliveryservice
Copy link
Contributor

/retest-required

Copy link
Contributor

@kikisdeliveryservice kikisdeliveryservice left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is in good shape, defer to Jerry for final review

/assign @yuqi-zhang

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 8, 2021
@yuqi-zhang
Copy link
Contributor

/lgtm
/retest

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

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

7 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@sinnykumari
Copy link
Contributor

skipping optional test to save bot keeping retesting
/skip

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@mkenigs mkenigs changed the title Use resource{apply,merge,read} functions provided by library-go Bug 2034364: Use resource{apply,merge,read} functions provided by library-go Dec 20, 2021
@openshift-ci openshift-ci bot added bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Dec 20, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 20, 2021

@mkenigs: This pull request references Bugzilla bug 2034364, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.10.0) matches configured target release for branch (4.10.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla (rioliu@redhat.com), skipping review request.

In response to this:

Bug 2034364: Use resource{apply,merge,read} functions provided by library-go

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/test-infra repository.

@sinnykumari
Copy link
Contributor

Putting hold until bugzilla and commit message is updated with with bug fix this PR does.
/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 20, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 20, 2021

@mkenigs: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-ovn-step-registry fb4a508809d377f16c849b59ab337d21abb5db91 link false /test e2e-ovn-step-registry
ci/prow/e2e-aws-serial fb4a508809d377f16c849b59ab337d21abb5db91 link false /test e2e-aws-serial
ci/prow/e2e-aws-workers-rhel7 fb4a508809d377f16c849b59ab337d21abb5db91 link false /test e2e-aws-workers-rhel7
ci/prow/e2e-aws-workers-rhel8 fb4a508809d377f16c849b59ab337d21abb5db91 link false /test e2e-aws-workers-rhel8
ci/prow/e2e-metal-ipi fb4a508809d377f16c849b59ab337d21abb5db91 link false /test e2e-metal-ipi
ci/prow/e2e-vsphere-upgrade fb4a508809d377f16c849b59ab337d21abb5db91 link false /test e2e-vsphere-upgrade
ci/prow/e2e-aws-upgrade-single-node fb4a508809d377f16c849b59ab337d21abb5db91 link false /test e2e-aws-upgrade-single-node
ci/prow/e2e-aws-single-node fb4a508809d377f16c849b59ab337d21abb5db91 link false /test e2e-aws-single-node
ci/prow/e2e-gcp-op-single-node fb4a508809d377f16c849b59ab337d21abb5db91 link false /test e2e-gcp-op-single-node
ci/prow/e2e-aws-disruptive fb4a508809d377f16c849b59ab337d21abb5db91 link false /test e2e-aws-disruptive
ci/prow/okd-e2e-aws fb4a508809d377f16c849b59ab337d21abb5db91 link false /test okd-e2e-aws
ci/prow/okd-images fb4a508809d377f16c849b59ab337d21abb5db91 link false /test okd-images

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/test-infra repository. I understand the commands that are listed here.

@yuqi-zhang
Copy link
Contributor

Sorry for the delay, updated bugzilla description. If that looks good, feel free to remove hold. Thanks!

@sinnykumari
Copy link
Contributor

Thanks Jerry!
/unhold

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 21, 2021
@sinnykumari
Copy link
Contributor

/test e2e-agnostic-upgrade

@openshift-merge-robot openshift-merge-robot merged commit 62fb49f into openshift:master Dec 21, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 21, 2021

@mkenigs: All pull requests linked via external trackers have merged:

Bugzilla bug 2034364 has been moved to the MODIFIED state.

In response to this:

Bug 2034364: Use resource{apply,merge,read} functions provided by library-go

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/test-infra repository.

mkenigs pushed a commit to mkenigs/machine-config-operator that referenced this pull request Jan 26, 2022
Currently we're getting the error:
Error creating event &Event...
Event ".16c2ed25cd8773b4" is invalid: involvedObject.namespace: Invalid value: "": does not match event.namespace

Related to Bug 2034364, overlooked in
openshift#2833
@mkenigs mkenigs deleted the use-library-go branch March 18, 2022 13:49
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. bugzilla/severity-low Referenced Bugzilla bug's severity is low for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. 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

7 participants