File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -245,6 +245,21 @@ func InstallConfigSync(nt *NT) error {
245245 return nil
246246}
247247
248+ // InstallConfigSyncFromManifest installs ConfigSync on the test cluster by directly
249+ // applying the manifest file using kubectl client-side apply
250+ func InstallConfigSyncFromManifest (nt * NT ) error {
251+ nt .T .Log ("[SETUP] Installing Config Sync directly from manifest file" )
252+
253+ nt .T .Logf ("Applying Config Sync manifest directly from %s" , configSyncManifest )
254+
255+ out , err := nt .Shell .Kubectl ("apply" , "-f" , configSyncManifest )
256+ if err != nil {
257+ return fmt .Errorf ("failed to apply Config Sync manifest: %v\n %s" , err , out )
258+ }
259+
260+ return nil
261+ }
262+
248263// uninstallConfigSync uninstalls ConfigSync on the test cluster
249264func uninstallConfigSync (nt * NT ) error {
250265 nt .T .Log ("[CLEANUP] Uninstalling Config Sync" )
Original file line number Diff line number Diff 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,7 +1302,7 @@ func TestNomosMigrate(t *testing.T) {
13011302
13021303 nt .T .Cleanup (func () {
13031304 // Restore state of Config Sync installation after test
1304- if err := nomostest .InstallConfigSync (nt ); err != nil {
1305+ if err := nomostest .InstallConfigSyncFromManifest (nt ); err != nil {
13051306 nt .T .Fatal (err )
13061307 }
13071308 })
@@ -1468,8 +1469,7 @@ func TestNomosMigrateMonoRepo(t *testing.T) {
14681469
14691470 nt .T .Cleanup (func () {
14701471 // Restore state of Config Sync installation after test.
1471- // This also emulates upgrading to the current version after migrating
1472- if err := nomostest .InstallConfigSync (nt ); err != nil {
1472+ if err := nomostest .InstallConfigSyncFromManifest (nt ); err != nil {
14731473 nt .T .Fatal (err )
14741474 }
14751475 })
@@ -1711,7 +1711,7 @@ func TestACMUninstallScript(t *testing.T) {
17111711
17121712 nt .T .Cleanup (func () {
17131713 // Restore state of Config Sync installation after test
1714- if err := nomostest .InstallConfigSync (nt ); err != nil {
1714+ if err := nomostest .InstallConfigSyncFromManifest (nt ); err != nil {
17151715 nt .T .Fatal (err )
17161716 }
17171717 })
You can’t perform that action at this time.
0 commit comments