From 845253373df85d680f3072f8b3fcb0636eea1347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Wei=C3=9Fe?= Date: Thu, 20 Jul 2023 09:40:14 +0200 Subject: [PATCH] Add check to cilium vals loading MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Daniel Weiße --- cli/internal/helm/client.go | 6 +++++- cli/internal/helm/loader.go | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/cli/internal/helm/client.go b/cli/internal/helm/client.go index 52e20feef..6deba8ef9 100644 --- a/cli/internal/helm/client.go +++ b/cli/internal/helm/client.go @@ -317,7 +317,11 @@ func (c *Client) loadUpgradeValues(ctx context.Context, conf *config.Config, cha switch chart.Metadata.Name { case ciliumInfo.chartName: releaseName = ciliumInfo.releaseName - values = ciliumVals[conf.GetProvider().String()] + var ok bool + values, ok = ciliumVals[conf.GetProvider().String()] + if !ok { + return "", nil, fmt.Errorf("cilium values for csp %q not found", conf.GetProvider().String()) + } case certManagerInfo.chartName: releaseName = certManagerInfo.releaseName values = loader.loadCertManagerValues() diff --git a/cli/internal/helm/loader.go b/cli/internal/helm/loader.go index 1df4d4aac..a26108ea3 100644 --- a/cli/internal/helm/loader.go +++ b/cli/internal/helm/loader.go @@ -155,7 +155,11 @@ func (i *ChartLoader) loadRelease(info chartInfo, helmWaitMode helm.WaitMode) (h switch info.releaseName { case ciliumInfo.releaseName: - values = ciliumVals[i.csp.String()] + var ok bool + values, ok = ciliumVals[i.csp.String()] + if !ok { + return helm.Release{}, fmt.Errorf("cilium values for csp %q not found", i.csp.String()) + } case certManagerInfo.releaseName: values = i.loadCertManagerValues() case constellationOperatorsInfo.releaseName: