Skip to content

Commit

Permalink
Catch failure when fetching component URLs
Browse files Browse the repository at this point in the history
Signed-off-by: killianmuldoon <[email protected]>
  • Loading branch information
killianmuldoon authored and k8s-infra-cherrypick-robot committed Apr 6, 2023
1 parent 6f96668 commit b4d717a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions test/framework/clusterctl/repository.go
Original file line number Diff line number Diff line change
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 b4d717a

Please sign in to comment.