@@ -43,6 +43,7 @@ import (
43
43
"kpt.dev/configsync/e2e/nomostest/ntopts"
44
44
"kpt.dev/configsync/e2e/nomostest/policy"
45
45
"kpt.dev/configsync/e2e/nomostest/syncsource"
46
+
46
47
"kpt.dev/configsync/e2e/nomostest/taskgroup"
47
48
nomostesting "kpt.dev/configsync/e2e/nomostest/testing"
48
49
"kpt.dev/configsync/e2e/nomostest/testpredicates"
@@ -1301,6 +1302,19 @@ func TestNomosMigrate(t *testing.T) {
1301
1302
1302
1303
nt .T .Cleanup (func () {
1303
1304
// 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 )
1304
1318
if err := nomostest .InstallConfigSync (nt ); err != nil {
1305
1319
nt .T .Fatal (err )
1306
1320
}
@@ -1469,6 +1483,19 @@ func TestNomosMigrateMonoRepo(t *testing.T) {
1469
1483
nt .T .Cleanup (func () {
1470
1484
// Restore state of Config Sync installation after test.
1471
1485
// 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 )
1472
1499
if err := nomostest .InstallConfigSync (nt ); err != nil {
1473
1500
nt .T .Fatal (err )
1474
1501
}
@@ -1711,6 +1738,19 @@ func TestACMUninstallScript(t *testing.T) {
1711
1738
1712
1739
nt .T .Cleanup (func () {
1713
1740
// 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 )
1714
1754
if err := nomostest .InstallConfigSync (nt ); err != nil {
1715
1755
nt .T .Fatal (err )
1716
1756
}
0 commit comments