@@ -265,7 +265,7 @@ func validateGlobals(specName string) {
265265}
266266
267267func updateCalico (config * clusterctl.E2EConfig , calicoYaml , calicoInterface string ) {
268- calicoManifestURL := fmt .Sprintf ("https://raw.githubusercontent.com/projectcalico/calico/%s/manifests/calico.yaml" , config .MustGetVariable ("CALICO_PATCH_RELEASE " ))
268+ calicoManifestURL := fmt .Sprintf ("https://raw.githubusercontent.com/projectcalico/calico/%s/manifests/calico.yaml" , config .MustGetVariable ("CALICO_VERSION " ))
269269 err := DownloadFile (calicoYaml , calicoManifestURL )
270270 Expect (err ).ToNot (HaveOccurred (), "Unable to download Calico manifest" )
271271 cniYaml , err := os .ReadFile (calicoYaml )
@@ -274,8 +274,10 @@ func updateCalico(config *clusterctl.E2EConfig, calicoYaml, calicoInterface stri
274274 Logf ("Replace the default CIDR with the one set in $POD_CIDR" )
275275 podCIDR := config .MustGetVariable ("POD_CIDR" )
276276 calicoContainerRegistry := config .MustGetVariable ("DOCKER_HUB_PROXY" )
277- cniYaml = []byte (strings .Replace (string (cniYaml ), "192.168.0.0/16" , podCIDR , - 1 ))
278- cniYaml = []byte (strings .Replace (string (cniYaml ), "docker.io" , calicoContainerRegistry , - 1 ))
277+ // Uncomment the CALICO_IPV4POOL_CIDR environment variable
278+ cniYaml = []byte (strings .ReplaceAll (string (cniYaml ), "# - name: CALICO_IPV4POOL_CIDR" , "- name: CALICO_IPV4POOL_CIDR" ))
279+ cniYaml = []byte (strings .ReplaceAll (string (cniYaml ), "# value: \" 192.168.0.0/16\" " , " value: \" " + podCIDR + "\" " ))
280+ cniYaml = []byte (strings .ReplaceAll (string (cniYaml ), "docker.io" , calicoContainerRegistry ))
279281
280282 yamlDocuments , err := splitYAML (cniYaml )
281283 Expect (err ).ToNot (HaveOccurred (), "Cannot unmarshal the calico yaml elements to golang objects" )
0 commit comments