Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
commit 17672e1f1b9c0c8e6fd6a30721a495602f513c81
Author: Dr. Stefan Schimanski <stefan.schimanski@gmail.com>
Date: Fri Jul 29 22:22:34 2022 +0200
e2e/syncer-fixture: fix cleanup
diff --git a/test/e2e/framework/fixture.go b/test/e2e/framework/fixture.go
index ff3f3226..4a43c048 100644
--- a/test/e2e/framework/fixture.go
+++ b/test/e2e/framework/fixture.go
@@ -584,7 +584,7 @@ func (sf SyncerFixture) Start(t *testing.T) *StartedSyncerFixture {
t.Errorf("failed to delete ClusterRole %q: %v", syncerID, err)
}
- t.Logf("Deleting synced resources for logical cluster %q, sync target %q", sf.WorkspaceClusterName, syncerConfig.SyncTargetName)
+ t.Logf("Deleting synced resources for logical cluster %s, sync target %s|%s", sf.WorkspaceClusterName, syncerConfig.SyncTargetWorkspace, syncerConfig.SyncTargetName)
namespaces, err := downstreamKubeClient.CoreV1().Namespaces().List(ctx, metav1.ListOptions{})
if err != nil {
t.Errorf("failed to list namespaces: %v", err)
@@ -599,7 +599,12 @@ func (sf SyncerFixture) Start(t *testing.T) *StartedSyncerFixture {
// Not a kcp-synced namespace
continue
}
- if locator.SyncTarget.Workspace == syncerConfig.SyncTargetWorkspace.String() {
+ if locator.Workspace != sf.WorkspaceClusterName {
+ // Not a namespace synced from this upstream workspace
+ continue
+ }
+ if locator.SyncTarget.Workspace != syncerConfig.SyncTargetWorkspace.String() ||
+ locator.SyncTarget.Name != syncerConfig.SyncTargetName {
// Not a namespace synced by this syncer
continue
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment