diff --git a/e2e/nomostest/config_sync.go b/e2e/nomostest/config_sync.go index 03104e1ab..8f9f0be0b 100644 --- a/e2e/nomostest/config_sync.go +++ b/e2e/nomostest/config_sync.go @@ -245,6 +245,21 @@ func InstallConfigSync(nt *NT) error { return nil } +// InstallConfigSyncFromManifest installs ConfigSync on the test cluster by directly +// applying the manifest file using kubectl client-side apply +func InstallConfigSyncFromManifest(nt *NT) error { + nt.T.Log("[SETUP] Installing Config Sync directly from manifest file") + + nt.T.Logf("Applying Config Sync manifest directly from %s", configSyncManifest) + + out, err := nt.Shell.Kubectl("apply", "-f", configSyncManifest) + if err != nil { + return fmt.Errorf("failed to apply Config Sync manifest: %v\n%s", err, out) + } + + return nil +} + // uninstallConfigSync uninstalls ConfigSync on the test cluster func uninstallConfigSync(nt *NT) error { nt.T.Log("[CLEANUP] Uninstalling Config Sync") diff --git a/e2e/testcases/cli_test.go b/e2e/testcases/cli_test.go index aebe72833..70aebe8cf 100644 --- a/e2e/testcases/cli_test.go +++ b/e2e/testcases/cli_test.go @@ -43,6 +43,7 @@ import ( "kpt.dev/configsync/e2e/nomostest/ntopts" "kpt.dev/configsync/e2e/nomostest/policy" "kpt.dev/configsync/e2e/nomostest/syncsource" + "kpt.dev/configsync/e2e/nomostest/taskgroup" nomostesting "kpt.dev/configsync/e2e/nomostest/testing" "kpt.dev/configsync/e2e/nomostest/testpredicates" @@ -1301,7 +1302,7 @@ func TestNomosMigrate(t *testing.T) { nt.T.Cleanup(func() { // Restore state of Config Sync installation after test - if err := nomostest.InstallConfigSync(nt); err != nil { + if err := nomostest.InstallConfigSyncFromManifest(nt); err != nil { nt.T.Fatal(err) } }) @@ -1468,8 +1469,7 @@ func TestNomosMigrateMonoRepo(t *testing.T) { nt.T.Cleanup(func() { // Restore state of Config Sync installation after test. - // This also emulates upgrading to the current version after migrating - if err := nomostest.InstallConfigSync(nt); err != nil { + if err := nomostest.InstallConfigSyncFromManifest(nt); err != nil { nt.T.Fatal(err) } }) @@ -1711,7 +1711,7 @@ func TestACMUninstallScript(t *testing.T) { nt.T.Cleanup(func() { // Restore state of Config Sync installation after test - if err := nomostest.InstallConfigSync(nt); err != nil { + if err := nomostest.InstallConfigSyncFromManifest(nt); err != nil { nt.T.Fatal(err) } })