Fix other uses of NewForConfigOrDie in contexts where we could return err

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
(cherry picked from commit 3da1bb3af2)
pull/4375/head
Brad Davidson 2021-10-29 11:39:27 -07:00 committed by Brad Davidson
parent c73aaf839b
commit 4a9a216232
1 changed files with 4 additions and 1 deletions

View File

@ -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),