From 2f1979f6376237c7acaba12a9a65fb4ef4c07b16 Mon Sep 17 00:00:00 2001 From: emirot Date: Mon, 5 Dec 2022 21:58:50 -0800 Subject: [PATCH] feat: error handling for http Signed-off-by: emirot --- .../kustomize/api/builtins/HelmChartInflationGenerator.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functions/go/render-helm-chart/third_party/sigs.k8s.io/kustomize/api/builtins/HelmChartInflationGenerator.go b/functions/go/render-helm-chart/third_party/sigs.k8s.io/kustomize/api/builtins/HelmChartInflationGenerator.go index 7ea7d4f28..477bb4509 100644 --- a/functions/go/render-helm-chart/third_party/sigs.k8s.io/kustomize/api/builtins/HelmChartInflationGenerator.go +++ b/functions/go/render-helm-chart/third_party/sigs.k8s.io/kustomize/api/builtins/HelmChartInflationGenerator.go @@ -178,6 +178,9 @@ func (p *HelmChartInflationGeneratorPlugin) createNewMergedValuesFiles(path stri if err != nil { return "", err } + if resp.StatusCode != http.StatusOK { + return "", fmt.Errorf("non-ok http status: %d returned", resp.StatusCode) + } defer resp.Body.Close() pValues, err = ioutil.ReadAll(resp.Body) if err != nil {