Skip to content

Commit

Permalink
Merge pull request #8489 from k8s-infra-cherrypick-robot/cherry-pick-…
Browse files Browse the repository at this point in the history
…8455-to-release-1.4

[release-1.4] 🐛 Catch failure when fetching component URLs
  • Loading branch information
k8s-ci-robot committed Apr 6, 2023
2 parents ace9289 + b4d717a commit c00aa6a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/framework/clusterctl/repository.go
Expand Up @@ -275,6 +275,9 @@ func getComponentSourceFromURL(ctx context.Context, source ProviderVersionSource
if err != nil {
return nil, errors.Wrapf(err, "failed to get %s", source.Value)
}
if resp.StatusCode != http.StatusOK {
return nil, errors.Errorf("failed to get %s: got status code %d", source.Value, resp.StatusCode)
}
defer resp.Body.Close()
buf, err = io.ReadAll(resp.Body)
if err != nil {
Expand Down

0 comments on commit c00aa6a

Please sign in to comment.