@@ -83,10 +83,11 @@ var (
8383 //
8484 // All paths must be relative to the test file that is running. There is probably
8585 // a more elegant way to do this.
86- baseDir = filepath .FromSlash ("../.." )
87- outputManifestsDir = filepath .Join (baseDir , ".output" , "staging" , "oss" )
88- configSyncManifest = filepath .Join (outputManifestsDir , "config-sync-manifest.yaml" )
89- multiConfigMaps = filepath .Join (baseDir , "e2e" , "raw-nomos" , configSyncManifests , multiConfigMapsName )
86+ baseDir = filepath .FromSlash ("../.." )
87+ outputManifestsDir = filepath .Join (baseDir , ".output" , "staging" , "oss" )
88+ configSyncManifest = filepath .Join (outputManifestsDir , "config-sync-manifest.yaml" )
89+ admissionWebhookManifest = filepath .Join (outputManifestsDir , "admission-webhook.yaml" )
90+ multiConfigMaps = filepath .Join (baseDir , "e2e" , "raw-nomos" , configSyncManifests , multiConfigMapsName )
9091)
9192
9293var (
@@ -245,6 +246,34 @@ func InstallConfigSync(nt *NT) error {
245246 return nil
246247}
247248
249+ // InstallConfigSyncFromManifest installs ConfigSync on the test cluster by directly
250+ // applying the manifest file using kubectl client-side apply
251+ func InstallConfigSyncFromManifest (nt * NT ) error {
252+ nt .T .Log ("[SETUP] Installing Config Sync directly from manifest file" )
253+
254+ nt .T .Logf ("Applying Config Sync manifest directly from %s" , configSyncManifest )
255+
256+ out , err := nt .Shell .Kubectl ("apply" , "-f" , configSyncManifest )
257+ if err != nil {
258+ return fmt .Errorf ("failed to apply Config Sync manifest: %v\n %s" , err , out )
259+ }
260+
261+ nt .T .Logf ("Applying multi-repo configmaps from %s" , multiConfigMaps )
262+ out , err = nt .Shell .Kubectl ("apply" , "-f" , multiConfigMaps )
263+ if err != nil {
264+ return fmt .Errorf ("failed to apply multi-repo configmaps: %v\n %s" , err , out )
265+ }
266+
267+ // Apply the admission webhook manifest
268+ nt .T .Logf ("Applying admission webhook manifest from %s" , admissionWebhookManifest )
269+ out , err = nt .Shell .Kubectl ("apply" , "-f" , admissionWebhookManifest )
270+ if err != nil {
271+ return fmt .Errorf ("failed to apply admission webhook manifest: %v\n %s" , err , out )
272+ }
273+
274+ return nil
275+ }
276+
248277// uninstallConfigSync uninstalls ConfigSync on the test cluster
249278func uninstallConfigSync (nt * NT ) error {
250279 nt .T .Log ("[CLEANUP] Uninstalling Config Sync" )
0 commit comments