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 {
245
245
return nil
246
246
}
247
247
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 WaitForConfigSyncReady (nt )
261
+ }
262
+
248
263
// uninstallConfigSync uninstalls ConfigSync on the test cluster
249
264
func uninstallConfigSync (nt * NT ) error {
250
265
nt .T .Log ("[CLEANUP] Uninstalling Config Sync" )
Original file line number Diff line number Diff line change @@ -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,7 +1302,7 @@ func TestNomosMigrate(t *testing.T) {
1301
1302
1302
1303
nt .T .Cleanup (func () {
1303
1304
// Restore state of Config Sync installation after test
1304
- if err := nomostest .InstallConfigSync (nt ); err != nil {
1305
+ if err := nomostest .InstallConfigSyncFromManifest (nt ); err != nil {
1305
1306
nt .T .Fatal (err )
1306
1307
}
1307
1308
})
@@ -1468,8 +1469,7 @@ func TestNomosMigrateMonoRepo(t *testing.T) {
1468
1469
1469
1470
nt .T .Cleanup (func () {
1470
1471
// 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 {
1473
1473
nt .T .Fatal (err )
1474
1474
}
1475
1475
})
@@ -1711,7 +1711,7 @@ func TestACMUninstallScript(t *testing.T) {
1711
1711
1712
1712
nt .T .Cleanup (func () {
1713
1713
// Restore state of Config Sync installation after test
1714
- if err := nomostest .InstallConfigSync (nt ); err != nil {
1714
+ if err := nomostest .InstallConfigSyncFromManifest (nt ); err != nil {
1715
1715
nt .T .Fatal (err )
1716
1716
}
1717
1717
})
You can’t perform that action at this time.
0 commit comments