diff --git a/cluster-sync/sync.sh b/cluster-sync/sync.sh index a3b72cd2e5..da0cc9c2d0 100755 --- a/cluster-sync/sync.sh +++ b/cluster-sync/sync.sh @@ -97,7 +97,7 @@ function wait_cdi_available { function configure_uploadproxy_override { host_port=$(./cluster-up/cli.sh ports uploadproxy | xargs) - override="127.0.0.1:$host_port" + override="https://127.0.0.1:$host_port" _kubectl patch cdi ${CR_NAME} --type=merge -p '{"spec": {"config": {"uploadProxyURLOverride": "'"$override"'"}}}' } diff --git a/tests/upload_test.go b/tests/upload_test.go index dc6884bee8..dfaa84a7b5 100644 --- a/tests/upload_test.go +++ b/tests/upload_test.go @@ -989,10 +989,16 @@ func uploadFileNameToPathWithClient(client *http.Client, requestFunc uploadFileN func findProxyURLCdiConfig(f *framework.Framework) string { config, err := f.CdiClient.CdiV1beta1().CDIConfigs().Get(context.TODO(), common.ConfigName, metav1.GetOptions{}) Expect(err).ToNot(HaveOccurred()) - if config.Status.UploadProxyURL != nil { - return fmt.Sprintf("https://%s", *config.Status.UploadProxyURL) + if config.Status.UploadProxyURL == nil { + return "" } - return "" + if strings.HasPrefix(*config.Status.UploadProxyURL, "http://") { + return *config.Status.UploadProxyURL + } + if strings.HasPrefix(*config.Status.UploadProxyURL, "https://") { + return *config.Status.UploadProxyURL + } + return "https://" + *config.Status.UploadProxyURL } func HasVolumeFromSecret(pod *v1.Pod, name string, secret *v1.Secret) bool {