From b4d717a0bb7ca31029eac4f3cc533f3c51a22095 Mon Sep 17 00:00:00 2001 From: killianmuldoon Date: Mon, 3 Apr 2023 16:18:49 +0100 Subject: [PATCH] Catch failure when fetching component URLs Signed-off-by: killianmuldoon --- test/framework/clusterctl/repository.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/framework/clusterctl/repository.go b/test/framework/clusterctl/repository.go index 92119c1d839e..a6061ca227fd 100644 --- a/test/framework/clusterctl/repository.go +++ b/test/framework/clusterctl/repository.go @@ -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 {