-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nodeup: create kubeconfig under admin or root #4077
Conversation
While the admin account is created on stock debian images, it isn't on all of them. Check admin first, then check root, and don't treat it as an error if neither is found - this is only a convenience.
nodeup/pkg/model/kubectl.go
Outdated
return err | ||
} | ||
|
||
if adminUser != "" { | ||
c.AddTask(&nodetasks.File{ | ||
Path: "/home/admin/.kube/", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the path differ here based on the value of adminUser
?
nodeup/pkg/model/kubectl.go
Outdated
Owner: s("admin"), | ||
Group: s("admin"), | ||
Owner: s(adminUser), | ||
Group: s(adminGroup), | ||
}) | ||
|
||
c.AddTask(&nodetasks.File{ | ||
Path: "/home/admin/.kube/config", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a couple comments, otherwise LGTM!
51fd5d5
to
743e482
Compare
You're absolutely right @KashifSaadat - thank you! |
Thanks! :) /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: KashifSaadat The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. |
While the admin account is created on stock debian images, it isn't on
all of them. Check admin first, then check root, and don't treat it as
an error if neither is found - this is only a convenience.