From 4a9a21623274e192ba01adf8c33b6ae9447487a8 Mon Sep 17 00:00:00 2001 From: Brad Davidson Date: Fri, 29 Oct 2021 11:39:27 -0700 Subject: [PATCH] Fix other uses of NewForConfigOrDie in contexts where we could return err Signed-off-by: Brad Davidson (cherry picked from commit 3da1bb3af2ed0a3ef06cc69bef8aaed42112ea7f) --- pkg/server/context.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/server/context.go b/pkg/server/context.go index fac72708db..d30f66486c 100644 --- a/pkg/server/context.go +++ b/pkg/server/context.go @@ -59,7 +59,10 @@ func NewContext(ctx context.Context, cfg string) (*Context, error) { return nil, err } - k8s := kubernetes.NewForConfigOrDie(restConfig) + k8s, err := kubernetes.NewForConfig(restConfig) + if err != nil { + return nil, err + } return &Context{ K3s: k3s.NewFactoryFromConfigOrDie(restConfig), Helm: helm.NewFactoryFromConfigOrDie(restConfig),