@@ -1205,7 +1205,7 @@ class ArgoCDTest {
12051205 " testPrefix-example-apps-production"
12061206 ]
12071207 // have to prepare activeNamespaces for unit-test, Application.groovy is setting this in integration way
1208- config. application. namespaces. dedicatedNamespaces = new LinkedHashSet<String > ([
1208+ config. application. namespaces. dedicatedNamespaces = new LinkedHashSet<String > ([
12091209 " monitoring" ,
12101210 " secrets" ,
12111211 " ingress-nginx" ,
@@ -1586,6 +1586,30 @@ class ArgoCDTest {
15861586 k8sCommands. assertExecuted(' kubectl patch secret argocd-default-cluster-config -n argocd --patch-file=/tmp/gitops-playground-patch-' )
15871587 }
15881588
1589+
1590+ @Test
1591+ void ' multiTenant folder gets deleted correctly if not in dedicated mode' () {
1592+ config. multiTenant. useDedicatedInstance = false
1593+
1594+ def argocd = createArgoCD()
1595+ argocd. install()
1596+
1597+ assertThat (Path . of(argocdRepo. getAbsoluteLocalRepoTmpDir(), ' multiTenant/' )). doesNotExist()
1598+ assertThat (Path . of(argocdRepo. getAbsoluteLocalRepoTmpDir(), ' applications/' )). exists()
1599+ assertThat (Path . of(argocdRepo. getAbsoluteLocalRepoTmpDir(), ' projects/' )). exists()
1600+ }
1601+
1602+ @Test
1603+ void ' deleting unused folder in dedicated mode' () {
1604+ config. multiTenant. useDedicatedInstance = true
1605+
1606+ def argocd = createArgoCD()
1607+ argocd. install()
1608+ assertThat (Path . of(argocdRepo. getAbsoluteLocalRepoTmpDir(), ' multiTenant/' )). exists()
1609+ assertThat (Path . of(argocdRepo. getAbsoluteLocalRepoTmpDir(), ' applications/' )). doesNotExist()
1610+ assertThat (Path . of(argocdRepo. getAbsoluteLocalRepoTmpDir(), ' projects/' )). doesNotExist()
1611+ }
1612+
15891613 @Test
15901614 void ' RBACs generated correctly' () {
15911615 config. application. namespaces. tenantNamespaces = new LinkedHashSet ([' testprefix-tenant-test1' , ' testprefix-tenant-test2' , ' testprefix-tenant-test3' ])
@@ -1728,6 +1752,7 @@ class ArgoCDTest {
17281752 ' http://scmm.scm-manager.svc.cluster.local/scm/3rd-party-dependencies/cert-manager.git'
17291753 )
17301754 }
1755+
17311756 @Test
17321757 void ' If using mirror with GitLab, ensure source repos in cluster-resources got right URL' () {
17331758 config. application. mirrorRepos = true
@@ -1786,6 +1811,7 @@ class ArgoCDTest {
17861811 ' http://scmm.test1-scm-manager.svc.cluster.local/scm/repo/3rd-party-dependencies/cert-manager'
17871812 )
17881813 }
1814+
17891815 @Test
17901816 void ' If using mirror with name-prefix, ensure source repos in cluster-resources got right URL' () {
17911817 config. application. mirrorRepos = true
0 commit comments