Commit 3da1bb3a authored by Brad Davidson's avatar Brad Davidson Committed by Brad Davidson

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

parent 5acd0b90
...@@ -347,7 +347,10 @@ func checkForCloudControllerPrivileges(ctx context.Context, runtime *config.Cont ...@@ -347,7 +347,10 @@ func checkForCloudControllerPrivileges(ctx context.Context, runtime *config.Cont
if err != nil { if err != nil {
return err return err
} }
authClient := authorizationv1client.NewForConfigOrDie(restConfig) authClient, err := authorizationv1client.NewForConfig(restConfig)
if err != nil {
return err
}
sar := &authorizationv1.SubjectAccessReview{ sar := &authorizationv1.SubjectAccessReview{
Spec: authorizationv1.SubjectAccessReviewSpec{ Spec: authorizationv1.SubjectAccessReviewSpec{
User: version.Program + "-cloud-controller-manager", User: version.Program + "-cloud-controller-manager",
......
...@@ -60,7 +60,10 @@ func NewContext(ctx context.Context, cfg string) (*Context, error) { ...@@ -60,7 +60,10 @@ func NewContext(ctx context.Context, cfg string) (*Context, error) {
return nil, errors.Wrap(err, "failed to register CRDs") return nil, errors.Wrap(err, "failed to register CRDs")
} }
k8s := kubernetes.NewForConfigOrDie(restConfig) k8s, err := kubernetes.NewForConfig(restConfig)
if err != nil {
return nil, err
}
return &Context{ return &Context{
K3s: k3s.NewFactoryFromConfigOrDie(restConfig), K3s: k3s.NewFactoryFromConfigOrDie(restConfig),
Helm: helm.NewFactoryFromConfigOrDie(restConfig), Helm: helm.NewFactoryFromConfigOrDie(restConfig),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment