Skip to content

Commit d04bb71

Browse files
authored
Merge pull request #8455 from killianmuldoon/pr-catch-clusterctl-failure
🐛 Catch failure when fetching component URLs
2 parents d410957 + 7cee46b commit d04bb71

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/framework/clusterctl/repository.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ func getComponentSourceFromURL(ctx context.Context, source ProviderVersionSource
275275
if err != nil {
276276
return nil, errors.Wrapf(err, "failed to get %s", source.Value)
277277
}
278+
if resp.StatusCode != http.StatusOK {
279+
return nil, errors.Errorf("failed to get %s: got status code %d", source.Value, resp.StatusCode)
280+
}
278281
defer resp.Body.Close()
279282
buf, err = io.ReadAll(resp.Body)
280283
if err != nil {

0 commit comments

Comments
 (0)