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

🌱 Add a common patcher and adopt it in registration #178

Conversation

qiujian16
Copy link
Member

Summary

Related issue(s)

Fixes #

@openshift-ci openshift-ci bot requested review from deads2k and mikeshng June 8, 2023 16:10
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 8, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: qiujian16

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

@codecov
Copy link

codecov bot commented Jun 8, 2023

Codecov Report

Patch coverage: 61.09% and project coverage change: -0.13 ⚠️

Comparison is base (6d4c488) 58.49% compared to head (b4f6e4f) 58.36%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #178      +/-   ##
==========================================
- Coverage   58.49%   58.36%   -0.13%     
==========================================
  Files         107      109       +2     
  Lines       11836    11713     -123     
==========================================
- Hits         6923     6836      -87     
+ Misses       4243     4212      -31     
+ Partials      670      665       -5     
Flag Coverage Δ
unit 58.36% <61.09%> (-0.13%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
pkg/registration/helpers/helpers.go 55.88% <ø> (-6.01%) ⬇️
...egistration/spoke/addon/registration_controller.go 26.33% <0.00%> (-0.79%) ⬇️
pkg/registration/spoke/lease/lease_controller.go 58.57% <ø> (ø)
...stration/spoke/registration/creating_controller.go 50.64% <ø> (ø)
...kg/registration/spoke/registration/registration.go 9.32% <0.00%> (ø)
...gistration/spoke/registration/secret_controller.go 32.20% <ø> (ø)
pkg/registration/spoke/spokeagent.go 32.07% <12.50%> (+1.32%) ⬆️
...g/registration/hub/managedclusterset/controller.go 30.66% <25.00%> (-0.26%) ⬇️
pkg/registration/spoke/addon/lease_controller.go 71.73% <37.50%> (-2.57%) ⬇️
pkg/registration/hub/lease/controller.go 53.53% <42.85%> (-0.64%) ⬇️
... and 9 more

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Signed-off-by: Jian Qiu <jqiu@redhat.com>
Status St `json:"status,omitempty"`
}

type patchFunc[R runtime.Object, Sp any, St any] func(context.Context, R, *Resource[Sp, St], *Resource[Sp, St], ...string) error
Copy link
Member

Choose a reason for hiding this comment

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

I do not see this being used in other places except line 39.

Copy link
Member Author

@qiujian16 qiujian16 Jun 9, 2023

Choose a reason for hiding this comment

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

oops we do not need this


type patcher[R runtime.Object, Sp any, St any] struct {
client PatchClient[R]
patchFunc patchFunc[R, Sp, St]
Copy link
Member

Choose a reason for hiding this comment

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

why do we need this patchFunc patchFunc[R, Sp, St]? can it be deleted?

t.Fatal(err)
}
if !equality.Semantic.DeepEqual(managedCluster.Status, newManagedClusterWithConditions(metav1.Condition{Type: "Type2"}).Status) {
t.Errorf("not patched correctly got %v", managedCluster.Spec)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
t.Errorf("not patched correctly got %v", managedCluster.Spec)
t.Errorf("not patched correctly got %v", managedCluster.Status)

@zhujian7
Copy link
Member

zhujian7 commented Jun 9, 2023

/lgtm
/hold for @elgnay to review

Signed-off-by: Jian Qiu <jqiu@redhat.com>
@zhujian7
Copy link
Member

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jun 12, 2023
@zhujian7
Copy link
Member

/unhold

@openshift-merge-robot openshift-merge-robot merged commit 3c9bfea into open-cluster-management-io:main Jun 12, 2023
ycyaoxdu pushed a commit to ycyaoxdu/ocm that referenced this pull request Jun 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants