-
Notifications
You must be signed in to change notification settings - Fork 366
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰Fix multiple CRDs/workspaces/versions #2751
馃悰Fix multiple CRDs/workspaces/versions #2751
Conversation
cbb0219
to
4e453a8
Compare
8d8048b
to
6d4f676
Compare
Got a green test run! Doing 1 more with a slight update to the kube PR |
/approve |
/retest |
@@ -143,3 +150,232 @@ func TestPartialMetadataCRD(t *testing.T) { | |||
require.True(t, enabled) | |||
} | |||
} | |||
|
|||
func TestPartialMetadataSameCRDMultipleWorkspaces(t *testing.T) { |
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.
This test exercises the partialmetadata issue.
Do you think we should also cover the watch-cache issue with a new test?
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.
We can probably add to the existing watch cache test?
/retest |
6d4f676
to
a996da8
Compare
Updated to pull in the latest kube |
@p0lyn0mial let's merge this and then follow up with a watch cache test? |
Ugh I really need to nail down what's going on with quota & gc |
sgtm, thanks |
Same test failure as what this PR is trying to fix, but a different root cause now:
Need to figure out why it's getting a 404 |
2716cf2
to
80879a5
Compare
pkg/syncer/spec/spec_process.go
Outdated
@@ -187,6 +188,18 @@ func (c *Controller) process(ctx context.Context, gvr schema.GroupVersionResourc | |||
return nil, fmt.Errorf("object to synchronize is expected to be Unstructured, but is %T", obj) | |||
} | |||
|
|||
if actualVersion := upstreamObj.GetAnnotations()[conversion.KCPOriginalAPIVersionAnnotation]; actualVersion != "" { |
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.
FYI @davidfestal
@@ -352,7 +353,20 @@ func (c *Controller) processResource(ctx context.Context, key string) error { | |||
} | |||
unstr = unstr.DeepCopy() | |||
|
|||
return c.reconcileResource(ctx, lclusterName, unstr, gvr) | |||
actualGVR := gvr |
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.
FYI @davidfestal
80879a5
to
9782f80
Compare
9782f80
to
bdf1d7e
Compare
Add an e2e test that verifies that we can support multiple CRDs for the same group+resource in different workspaces, with different API versions. Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
Pull in changes that fix wildcard partial metadata requests when there are CRDs serving different versions of the same group/resource in different workspaces. Pull in changes that fix the watch cache for normal CRDs - it was breaking because each workspace has its own watch cache per normal CRD, yet the cache was listing/watching CRs from all workspaces, leading to conversion errors. Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
The dynamic discovery shared informer factory does a wildcard partial metadata list/watch against specific API versions. When an informer event comes in for a specific item, it's for a specific API version (whatever the factory used), but that doesn't necessarily mean it's the API version of the actual object being retrieved (the API version doesn't matter because we're only getting partial metadata). But if you want to UPDATE the object, you must know its appropriate API version. This is now presented via annotations in kcp.io/original-api-version. This updates the permission claim reconcilers to use the annotation when making dynamic client requests. Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
The dynamic discovery shared informer factory does a wildcard partial metadata list/watch against specific API versions. When an informer event comes in for a specific item, it's for a specific API version (whatever the factory used), but that doesn't necessarily mean it's the API version of the actual object being retrieved (the API version doesn't matter because we're only getting partial metadata). But if you want to UPDATE/DELETE the object, you must know its appropriate API version. This is now presented via annotations in kcp.io/original-api-version. This updates the reconciler to use the annotation when making dynamic client requests. Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
The dynamic discovery shared informer factory does a wildcard partial metadata list/watch against specific API versions. When an informer event comes in for a specific item, it's for a specific API version (whatever the factory used), but that doesn't necessarily mean it's the API version of the actual object being retrieved (the API version doesn't matter because we're only getting partial metadata). But if you want to UPDATE/DELETE the object, you must know its appropriate API version. This is now presented via annotations in kcp.io/original-api-version. This updates the spec syncer to use the annotation when making dynamic client requests against the upstream. Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
bdf1d7e
to
b82da8a
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ncdc, stevekuznetsov 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 |
Pushed a commit similar to #2684 to deflake the status half of the test. Flake was kcp-dev/contrib-tmc#53 |
Make sure the informer factories have synced the specific GVRs we care about in the test before clearing test client actions. This way, we know we won't get watch actions from the informers after we've cleared the actions, which is what was causing the flakiness. Signed-off-by: Andy Goldstein <andy.goldstein@redhat.com>
59fb6f1
to
fbcfc28
Compare
/lgtm |
Summary
k8s PRs:
Related issue(s)
Fixes #2738