Skip to content

Commit 7cee46b

Browse files
Catch failure when fetching component URLs
Signed-off-by: killianmuldoon <[email protected]>
1 parent 01f619f commit 7cee46b

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)