-
Notifications
You must be signed in to change notification settings - Fork 398
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
SyncTarget Uniqueness #1600
SyncTarget Uniqueness #1600
Conversation
Skipping CI for Draft Pull Request. |
75c54f7
to
70acfbc
Compare
/test e2e |
/retest |
70acfbc
to
c9aeb5c
Compare
/test all |
a49af13
to
ab779a3
Compare
/retest |
/test all |
/retest |
a9173b5
to
f58643d
Compare
f58643d
to
54be0f4
Compare
3d3d72a
to
a6150fe
Compare
@@ -48,7 +50,7 @@ const ( | |||
byWorkspace = ControllerName + "-byWorkspace" // will go away with scoping | |||
) | |||
|
|||
type CreateAPIDefinitionFunc func(syncTargetName string, apiResourceSchema *apisv1alpha1.APIResourceSchema, version string, identityHash string) (apidefinition.APIDefinition, error) | |||
type CreateAPIDefinitionFunc func(syncTargetName string, syncTargetWorkspace logicalcluster.Name, apiResourceSchema *apisv1alpha1.APIResourceSchema, version string, identityHash string) (apidefinition.APIDefinition, 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.
switch order, cluster first
test/e2e/framework/fixture.go
Outdated
@@ -599,7 +599,7 @@ func (sf SyncerFixture) Start(t *testing.T) *StartedSyncerFixture { | |||
// Not a kcp-synced namespace | |||
continue | |||
} | |||
if locator.Workspace.String() != syncerConfig.SyncTargetWorkspace.String() { | |||
if locator.SyncTarget.Workspace == syncerConfig.SyncTargetWorkspace.String() { |
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 does this only compare the workspace, not the name?
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.
and why !=
=> ==
?
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.
metav1.GetOptions{}, | ||
) | ||
require.NoError(t, err) | ||
syncTargetKey := workloadv1alpha1.ToSyncTargetKey(syncTarget.GetName(), logicalcluster.From(syncTarget)) |
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 this change? Just take syncerFixture.SyncerConfig.SyncTargetName
and syncerFixture.SyncerConfig.SyncTargetWorkspace
?
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 get the syncTarget for the UID (line 91) and then reuse the name/workspace here, but I can use the ones from fixture.
@@ -157,6 +157,7 @@ func TestPlacementUpdate(t *testing.T) { | |||
}, | |||
}, metav1.CreateOptions{}) | |||
require.NoError(t, err) | |||
syncTargetKey := workloadv1alpha1.ToSyncTargetKey(firstSyncTargetName, syncerFixture.SyncerConfig.SyncTargetWorkspace) |
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 there is a second synctarget around, call this firstSyncTargetKey
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.
done
_, err := downstreamKubeClient.AppsV1().Deployments(downstreamNamespaceName).Get(ctx, upstreamDeployment.Name, metav1.GetOptions{}) | ||
if apierrors.IsNotFound(err) { | ||
return true | ||
} | ||
require.NoError(t, err) | ||
return false | ||
}, 5*time.Second, time.Second, "downstream Deployment got deleted or there was an error", downstreamNamespaceName, upstreamDeployment.Name) | ||
}, 5*time.Second, time.Second, "downstream Deployment %s/%s got deleted or there was an error", downstreamNamespaceName, upstreamDeployment.Name) |
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.
}, 5*time.Second, time.Second, "downstream Deployment %s/%s got deleted or there was an error", downstreamNamespaceName, upstreamDeployment.Name) | |
}, 5*time.Second, time.Second, "downstream Deployment %s|%s got deleted or there was an error", downstreamNamespaceName, upstreamDeployment.Name) |
283e706
to
3c7c6ef
Compare
3c7c6ef
to
39dafd5
Compare
2435b2f
to
1f302cd
Compare
/retest |
1f302cd
to
02f26dc
Compare
Squashed. /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sttts 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 |
02f26dc
to
fc38492
Compare
/lgtm |
/retest |
/test e2e-multiple-runs |
This PR improves the uniqueness of the labels/annotations/finalizers that rely currently on the SyncTarget Name by replacing it with a hash generated from the SyncTarget Name + SyncTarget workspace.
workloadv1alpha1
:ToSyncTargetKey(syncTargetName, syncTargetWorkspace)