Skip to content
This repository was archived by the owner on Aug 12, 2025. It is now read-only.

Commit d05fd70

Browse files
committed
update e2e tests
1 parent f4201c5 commit d05fd70

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

test/e2e/suite_test.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,19 +160,24 @@ func loadE2EConfig(configPath string) *clusterctl.E2EConfig {
160160
config := clusterctl.LoadE2EConfig(context.TODO(), clusterctl.LoadE2EConfigInput{ConfigPath: configPath})
161161
Expect(config).ToNot(BeNil(), "Failed to load E2E config from %s", configPath)
162162

163-
// Read CNI file and set CNI_RESOURCES environmental variable
164-
Expect(config.Variables).To(HaveKey(capi_e2e.CNIPath), "Missing %s variable in the config", capi_e2e.CNIPath)
165-
clusterctl.SetCNIEnvVar(config.GetVariable(capi_e2e.CNIPath), capi_e2e.CNIResources)
166-
167163
return config
168164
}
169165

170166
func createClusterctlLocalRepository(config *clusterctl.E2EConfig, repositoryFolder string) string {
171-
clusterctlConfig := clusterctl.CreateRepository(context.TODO(), clusterctl.CreateRepositoryInput{
167+
createRepositoryInput := clusterctl.CreateRepositoryInput{
172168
E2EConfig: config,
173169
RepositoryFolder: repositoryFolder,
174-
})
170+
}
171+
172+
// Ensuring a CNI file is defined in the config and register a FileTransformation to inject the referenced file as in place of the CNI_RESOURCES envSubst variable.
173+
Expect(config.Variables).To(HaveKey(capi_e2e.CNIPath), "Missing %s variable in the config", capi_e2e.CNIPath)
174+
cniPath := config.GetVariable(capi_e2e.CNIPath)
175+
Expect(cniPath).To(BeAnExistingFile(), "The %s variable should resolve to an existing file", capi_e2e.CNIPath)
176+
createRepositoryInput.RegisterClusterResourceSetConfigMapTransformation(cniPath, capi_e2e.CNIResources)
177+
178+
clusterctlConfig := clusterctl.CreateRepository(context.TODO(), createRepositoryInput)
175179
Expect(clusterctlConfig).To(BeAnExistingFile(), "The clusterctl config file does not exists in the local repository %s", repositoryFolder)
180+
176181
return clusterctlConfig
177182
}
178183

0 commit comments

Comments
 (0)