Skip to content

Commit 5bb86cc

Browse files
committed
Correctly restore reconcilermanager and resourcegroupmanager in nomos-cli test
1 parent 83dbb3e commit 5bb86cc

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

e2e/testcases/cli_test.go

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ import (
4343
"kpt.dev/configsync/e2e/nomostest/ntopts"
4444
"kpt.dev/configsync/e2e/nomostest/policy"
4545
"kpt.dev/configsync/e2e/nomostest/syncsource"
46+
4647
"kpt.dev/configsync/e2e/nomostest/taskgroup"
4748
nomostesting "kpt.dev/configsync/e2e/nomostest/testing"
4849
"kpt.dev/configsync/e2e/nomostest/testpredicates"
@@ -1301,6 +1302,19 @@ func TestNomosMigrate(t *testing.T) {
13011302

13021303
nt.T.Cleanup(func() {
13031304
// Restore state of Config Sync installation after test
1305+
// Legacy ConfigManagement sets readiness on reconciler-manager and resource-group-controller,
1306+
// which isn’t reliably cleaned up after tests. Delete both to ensure a fresh
1307+
// install instead of patching.
1308+
rmDeployment := k8sobjects.DeploymentObject(
1309+
core.Name(reconcilermanager.ManagerName),
1310+
core.Namespace(configsync.ControllerNamespace),
1311+
)
1312+
rgDeployment := k8sobjects.DeploymentObject(
1313+
core.Name(configmanagement.RGControllerName),
1314+
core.Namespace(configmanagement.RGControllerNamespace),
1315+
)
1316+
nt.KubeClient.Delete(rmDeployment)
1317+
nt.KubeClient.Delete(rgDeployment)
13041318
if err := nomostest.InstallConfigSync(nt); err != nil {
13051319
nt.T.Fatal(err)
13061320
}
@@ -1469,6 +1483,19 @@ func TestNomosMigrateMonoRepo(t *testing.T) {
14691483
nt.T.Cleanup(func() {
14701484
// Restore state of Config Sync installation after test.
14711485
// This also emulates upgrading to the current version after migrating
1486+
// Legacy ConfigManagement sets readiness on reconciler-manager and resource-group-controller,
1487+
// which isn’t reliably cleaned up after tests. Delete both to ensure a fresh
1488+
// install instead of patching.
1489+
rmDeployment := k8sobjects.DeploymentObject(
1490+
core.Name(reconcilermanager.ManagerName),
1491+
core.Namespace(configsync.ControllerNamespace),
1492+
)
1493+
rgDeployment := k8sobjects.DeploymentObject(
1494+
core.Name(configmanagement.RGControllerName),
1495+
core.Namespace(configmanagement.RGControllerNamespace),
1496+
)
1497+
nt.KubeClient.Delete(rmDeployment)
1498+
nt.KubeClient.Delete(rgDeployment)
14721499
if err := nomostest.InstallConfigSync(nt); err != nil {
14731500
nt.T.Fatal(err)
14741501
}
@@ -1711,6 +1738,19 @@ func TestACMUninstallScript(t *testing.T) {
17111738

17121739
nt.T.Cleanup(func() {
17131740
// Restore state of Config Sync installation after test
1741+
// Legacy ConfigManagement sets readiness on reconciler-manager and resource-group-controller,
1742+
// which isn’t reliably cleaned up after tests. Delete both to ensure a fresh
1743+
// install instead of patching.
1744+
rmDeployment := k8sobjects.DeploymentObject(
1745+
core.Name(reconcilermanager.ManagerName),
1746+
core.Namespace(configsync.ControllerNamespace),
1747+
)
1748+
rgDeployment := k8sobjects.DeploymentObject(
1749+
core.Name(configmanagement.RGControllerName),
1750+
core.Namespace(configmanagement.RGControllerNamespace),
1751+
)
1752+
nt.KubeClient.Delete(rmDeployment)
1753+
nt.KubeClient.Delete(rgDeployment)
17141754
if err := nomostest.InstallConfigSync(nt); err != nil {
17151755
nt.T.Fatal(err)
17161756
}

0 commit comments

Comments
 (0)