Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
3da1bb3a
Commit
3da1bb3a
authored
Oct 29, 2021
by
Brad Davidson
Committed by
Brad Davidson
Oct 29, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix other uses of NewForConfigOrDie in contexts where we could return err
Signed-off-by:
Brad Davidson
<
brad.davidson@rancher.com
>
parent
5acd0b90
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
server.go
pkg/daemons/control/server.go
+4
-1
context.go
pkg/server/context.go
+4
-1
No files found.
pkg/daemons/control/server.go
View file @
3da1bb3a
...
...
@@ -347,7 +347,10 @@ func checkForCloudControllerPrivileges(ctx context.Context, runtime *config.Cont
if
err
!=
nil
{
return
err
}
authClient
:=
authorizationv1client
.
NewForConfigOrDie
(
restConfig
)
authClient
,
err
:=
authorizationv1client
.
NewForConfig
(
restConfig
)
if
err
!=
nil
{
return
err
}
sar
:=
&
authorizationv1
.
SubjectAccessReview
{
Spec
:
authorizationv1
.
SubjectAccessReviewSpec
{
User
:
version
.
Program
+
"-cloud-controller-manager"
,
...
...
pkg/server/context.go
View file @
3da1bb3a
...
...
@@ -60,7 +60,10 @@ func NewContext(ctx context.Context, cfg string) (*Context, error) {
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
{
K3s
:
k3s
.
NewFactoryFromConfigOrDie
(
restConfig
),
Helm
:
helm
.
NewFactoryFromConfigOrDie
(
restConfig
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment