-
Notifications
You must be signed in to change notification settings - Fork 94
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
🌱 Add a common patcher and adopt it in registration #178
Conversation
[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 |
15e9f7f
to
bfb1700
Compare
Codecov ReportPatch coverage:
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
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
Signed-off-by: Jian Qiu <jqiu@redhat.com>
bfb1700
to
44a74d1
Compare
pkg/common/patcher/patcher.go
Outdated
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
pkg/common/patcher/patcher.go
Outdated
|
||
type patcher[R runtime.Object, Sp any, St any] struct { | ||
client PatchClient[R] | ||
patchFunc patchFunc[R, Sp, St] |
There was a problem hiding this comment.
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?
pkg/common/patcher/patcher_test.go
Outdated
t.Fatal(err) | ||
} | ||
if !equality.Semantic.DeepEqual(managedCluster.Status, newManagedClusterWithConditions(metav1.Condition{Type: "Type2"}).Status) { | ||
t.Errorf("not patched correctly got %v", managedCluster.Spec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.Errorf("not patched correctly got %v", managedCluster.Spec) | |
t.Errorf("not patched correctly got %v", managedCluster.Status) |
/lgtm |
Signed-off-by: Jian Qiu <jqiu@redhat.com>
2877bf6
to
b4f6e4f
Compare
/lgtm |
/unhold |
…-io#178) Signed-off-by: Yang Le <yangle@redhat.com>
Summary
Related issue(s)
Fixes #