You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// 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.
193
195
Expect(config.Variables).To(HaveKey(capi_e2e.CNIPath), "Missing %s variable in the config", capi_e2e.CNIPath)
196
+
cniName:=config.MustGetVariable("CNI_NAME")
194
197
cniPath:=config.MustGetVariable(capi_e2e.CNIPath)
195
-
switchosType {
196
-
caseosTypeLeap:
197
-
updateCalico(config, cniPath, "eth1")
198
+
cniInterface:="enp2s0"
199
+
ifosType==osTypeLeap {
200
+
cniInterface="eth1"
201
+
}
202
+
203
+
switchcniName {
204
+
case"cilium":
205
+
updateCilium(config, cniPath)
206
+
case"calico":
207
+
updateCalico(config, cniPath, cniInterface)
198
208
default:
199
-
updateCalico(config, cniPath, "enp2s0")
209
+
Expect(cniName).To(Or(Equal("calico"), Equal("cilium")), "Invalid CNI type %q, only 'cilium' and 'calico' are supported", cniName)
200
210
}
211
+
201
212
Expect(cniPath).To(BeAnExistingFile(), "The %s variable should resolve to an existing file", capi_e2e.CNIPath)
Expect(err).ToNot(HaveOccurred(), "Cannot print out the update to the file")
313
324
}
314
325
326
+
// updateCilium generates and writes a Cilium CNI manifest to the CNI path specified in e2e config.
327
+
// It retrieves the Cilium version from e2e configuration, downloads the corresponding Helm chart, generates a manifest from the chart template, and writes the manifest to the CNI path.
0 commit comments