-
Notifications
You must be signed in to change notification settings - Fork 878
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 cache source annotation for objects returned by proxy #2469
Conversation
6e849cc
to
10c1360
Compare
/assign @XiShanYongYe-Chang |
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.
Thanks~
return nil, err | ||
} | ||
|
||
if requestInfo.Verb != "update" { |
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.
Is there a possibility that the verb is patch
?
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.
Users will not patch resourceVersion and cached source annotation.
@@ -205,6 +208,12 @@ func (c *MultiClusterCache) List(ctx context.Context, gvr schema.GroupVersionRes | |||
if err != nil { | |||
return 0, "", err | |||
} | |||
|
|||
for i := range extractList { | |||
// TODO: add annotation will modify the object in cache, shall we deep copy it? The modification seems not bad. |
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.
If so, this todo can be removed and can be updated with comment.
test/e2e/search_test.go
Outdated
|
||
deleteAnnotationAfterTest = func(c kubernetes.Interface, name string, anno string) { | ||
data := []byte(`{"metadata": {"annotations": {"` + anno + `":null}}}`) | ||
_, _ = c.CoreV1().Nodes().Patch(context.TODO(), name, types.StrategicMergePatchType, data, metav1.PatchOptions{}) |
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.
The patch verb may fail in the CI environment.
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.
You mean throw the patch error? IMO, this is just a clean method, error can be ignored. I will add a log to print this error.
}, time.Second*10, 0).Should(gomega.BeTrue()) | ||
|
||
gomega.Expect(get.Annotations[clusterv1alpha1.CacheSourceAnnotationKey]).Should(gomega.Equal(member1)) |
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.
After this line maybe also need to deleteAnnotationAfterTest
Signed-off-by: yingjinhui <yingjinhui@didiglobal.com>
10c1360
to
a9fcfa2
Compare
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.
Thanks~
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: XiShanYongYe-Chang 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 |
Hi @ikaven1024, can you help update the release-note to:
|
I update the kind from |
Signed-off-by: yingjinhui yingjinhui@didiglobal.com
What type of PR is this?
/kind feature
What this PR does / why we need it:
resource.karmada.io/cached-from-cluster
to objects returned by proxy, staying the same with search.Which issue(s) this PR fixes:
Fixes #2463
Special notes for your reviewer:
Does this PR introduce a user-facing change?: