Skip to content

Commit 4afc1ac

Browse files
authored
test: fix TestSplitRSyncsWithDeletion on CSR (#1638)
Tests on CSR require workload identity bindings to be created for every RSync. The new TestSplitRSyncsWithDeletion test case used new RSync names that did not have workload identity bindings. This fixes the issue by changing the RSync names to reuse already provisioned workload identity bindings.
1 parent 0c6b999 commit 4afc1ac

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

e2e/testcases/sync_ordering_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -688,19 +688,19 @@ func TestSplitRSyncsWithDeletion(t *testing.T) {
688688
o.SetNamespace("foo")
689689
return o
690690
}
691-
tenantNS1 := "tenant-ns-1"
692-
tenantNS2 := "tenant-ns-2"
691+
tenantNS1 := frontendNamespace
692+
tenantNS2 := backendNamespace
693693
cm1 := func() *corev1.ConfigMap {
694694
return k8sobjects.ConfigMapObject(core.Name("cm1"), core.Namespace(tenantNS1))
695695
}
696696
sa1 := func() *corev1.ServiceAccount {
697697
return k8sobjects.ServiceAccountObject("sa1", core.Namespace(tenantNS2))
698698
}
699699
rootSync := nomostest.DefaultRootSyncID
700-
rootSync1 := core.RootSyncID("root-sync-1")
701-
rootSync2 := core.RootSyncID("root-sync-2")
702-
repoSync1 := core.RepoSyncID("repo-sync-1", tenantNS1)
703-
repoSync2 := core.RepoSyncID("repo-sync-2", tenantNS2)
700+
rootSync1 := core.RootSyncID("sync-x")
701+
rootSync2 := core.RootSyncID("sync-y")
702+
repoSync1 := core.RepoSyncID(configsync.RepoSyncName, tenantNS1)
703+
repoSync2 := core.RepoSyncID(configsync.RepoSyncName, tenantNS2)
704704
nt := nomostest.New(t, nomostesting.Lifecycle,
705705
ntopts.SyncWithGitSource(rootSync, ntopts.Unstructured),
706706
ntopts.SyncWithGitSource(rootSync1, ntopts.Unstructured),

e2e/testinfra/terraform/modules/service_account/service_account.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ resource "google_service_account_iam_member" "k8s_sa_binding" {
4848
"serviceAccount:${data.google_project.project.project_id}.svc.id.goog[config-management-system/ns-reconciler-test-ns-rs-test-2-9]",
4949
# RepoSync used in TestNamespaceRepo_Delegated, TestDeleteRepoSync_Delegated_AndRepoSyncV1Alpha1, TestDeleteRepoSync_Centralized_AndRepoSyncV1Alpha1, TestManageSelfRepoSync, TestDeleteNamespaceReconcilerDeployment, TestReconcilerManagerRootSyncCRDMissing.
5050
"serviceAccount:${data.google_project.project.project_id}.svc.id.goog[config-management-system/ns-reconciler-bookstore]",
51-
# RepoSync used in TestNoSSLVerifyV1Alpha1, TestNoSSLVerifyV1Beta1, TestOverrideGitSyncDepthV1Alpha1, TestOverrideGitSyncDepthV1Beta1, TestOverrideReconcilerResourcesV1Alpha1, TestOverrideReconcilerResourcesV1Beta1.
51+
# RepoSync used in TestNoSSLVerifyV1Alpha1, TestNoSSLVerifyV1Beta1, TestOverrideGitSyncDepthV1Alpha1, TestOverrideGitSyncDepthV1Beta1, TestOverrideReconcilerResourcesV1Alpha1, TestOverrideReconcilerResourcesV1Beta1, TestSplitRSyncsWithDeletion.
5252
"serviceAccount:${data.google_project.project.project_id}.svc.id.goog[config-management-system/ns-reconciler-backend]",
53-
# RepoSync used in TestOverrideRepoSyncLogLevel, TestOverrideReconcilerResourcesV1Alpha1, TestOverrideReconcilerResourcesV1Beta1.
53+
# RepoSync used in TestOverrideRepoSyncLogLevel, TestOverrideReconcilerResourcesV1Alpha1, TestOverrideReconcilerResourcesV1Beta1, TestSplitRSyncsWithDeletion.
5454
"serviceAccount:${data.google_project.project.project_id}.svc.id.goog[config-management-system/ns-reconciler-frontend]",
5555
# RootSync used in TestRootSyncRoleRefs, TestNamespaceStrategyMultipleRootSyncs.
5656
"serviceAccount:${data.google_project.project.project_id}.svc.id.goog[config-management-system/root-reconciler-sync-a]",
@@ -64,7 +64,7 @@ resource "google_service_account_iam_member" "k8s_sa_binding" {
6464
"serviceAccount:${data.google_project.project.project_id}.svc.id.goog[config-management-system/ns-reconciler-invalid-teardown]",
6565
# RepoSync used in TestReconcilerManagerTeardownRepoSyncWithReconcileTimeout.
6666
"serviceAccount:${data.google_project.project.project_id}.svc.id.goog[config-management-system/ns-reconciler-reconcile-timeout]",
67-
# RootSync used in TestNamespaceStrategyMultipleRootSyncs.
67+
# RootSync used in TestNamespaceStrategyMultipleRootSyncs, TestSplitRSyncsWithDeletion.
6868
"serviceAccount:${data.google_project.project.project_id}.svc.id.goog[config-management-system/root-reconciler-sync-x]",
6969
"serviceAccount:${data.google_project.project.project_id}.svc.id.goog[config-management-system/root-reconciler-sync-y]",
7070
# RootSync and RepoSync used in TestComposition

0 commit comments

Comments
 (0)