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
retryError=errors.Wrapf(err, "failed to download file %q from %q release via redirect location %q: failed to create request", *release.TagName, fileName, redirect)
394
-
returnfalse, nil
395
-
}
396
-
397
-
response, err:=http.DefaultClient.Do(req) //nolint:bodyclose // (NB: The reader is actually closed in a defer)
398
-
iferr!=nil {
399
-
retryError=errors.Wrapf(err, "failed to download file %q from %q release via redirect location %q", *release.TagName, fileName, redirect)
400
-
returnfalse, nil
401
-
}
402
-
reader=response.Body
391
+
// NOTE: DownloadReleaseAsset should not return a redirect address when used with the DefaultClient
392
+
retryError=errors.New("unexpected redirect while downloading the release asset")
providerConfig:=config.NewProvider("test", "https://github.com/o/r/releases/v0.4.1/file.yaml", clusterctlv1.CoreProviderType) // tree/main/path not relevant for the test
722
+
providerConfig:=config.NewProvider("test", "https://github.com/o/r/releases/v0.4.1/file.yaml", clusterctlv1.CoreProviderType) // tree/main/path not relevant for the test
723
+
providerConfigWithRedirect:=config.NewProvider("test", "https://github.com/o/r-with-redirect/releases/v0.4.1/file.yaml", clusterctlv1.CoreProviderType) // tree/main/path not relevant for the test
723
724
724
725
// test.NewFakeGitHub an handler for returning a fake release asset
0 commit comments