-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Add kubectl desc nodes to minikube logs #7105
Add kubectl desc nodes to minikube logs #7105
Conversation
Hi @prasadkatti. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: prasadkatti The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Can one of the admins verify this patch? |
/assign @priyawadhwa Hi @priyawadhwa. I am a newbie at |
Codecov Report
@@ Coverage Diff @@
## master #7105 +/- ##
=======================================
Coverage 37.12% 37.12%
=======================================
Files 146 146
Lines 9124 9124
=======================================
Hits 3387 3387
Misses 5321 5321
Partials 416 416
|
/ok-to-test |
Error: running mkcmp: exit status 1 |
pkg/minikube/logs/logs.go
Outdated
@@ -186,5 +190,15 @@ func logCommands(r cruntime.Manager, bs bootstrapper.Bootstrapper, length int, f | |||
} | |||
cmds[r.Name()] = r.SystemLogCmd(length) | |||
cmds["container status"] = cruntime.ContainerStatusCommand() | |||
|
|||
cfg, err := config.Load(viper.GetString(config.ProfileName)) | |||
if err != nil && !config.IsNotExist(err) { |
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.
You can just say
if err != nil
here
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.
okay, thanks for the review! Are the failing checks unrelated to my changes? I couldn't really tell.
All Times minikube: [ 70.045328 73.533552 72.477204] Average minikube: 72.018694 Averages Time Per Log
|
pkg/minikube/logs/logs.go
Outdated
@@ -186,5 +190,15 @@ func logCommands(r cruntime.Manager, bs bootstrapper.Bootstrapper, length int, f | |||
} | |||
cmds[r.Name()] = r.SystemLogCmd(length) | |||
cmds["container status"] = cruntime.ContainerStatusCommand() | |||
|
|||
cfg, err := config.Load(viper.GetString(config.ProfileName)) |
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.
Nicely done! Thank you!
So, the frustrating part is that the configuration for this profile is already loaded, but the logs package does not have access to it. If it isn't too much trouble on your part, can you help us get that addressed? It'll be cleaner and faster that way.
I know I said differently in the issue, but lets start by moving this addition to the kubeadm
bootstrapper, since it's the only one that guarantees where the kubelet is installed. Start my moving your code here:
func (k *Bootstrapper) LogCommands(o bootstrapper.LogOptions) map[string]string { |
Now, to plumb in our missing loaded configuration (config.ClusterConfig
). First pass the cfg
variable to logs.Output
:
minikube/cmd/minikube/cmd/logs.go
Line 109 in 729642e
err = logs.Output(cr, bs, runner, numberOfLines) |
Then logs.logCommands
, where we are now:
minikube/pkg/minikube/logs/logs.go
Line 158 in 729642e
cmds := logCommands(r, bs, lines, false) |
Then to bs.LogCommands
(effectively kubeadm.LogCommands
), which handles bootstrapper specific logs:
minikube/pkg/minikube/logs/logs.go
Line 196 in 729642e
cmds := bs.LogCommands(bootstrapper.LogOptions{Lines: length, Follow: follow}) |
One tip: Some packages name the config.ClusterConfig
variable as cfg
, some name it cc
. Use whichever nomenclature you find in the package, which I believe will usually be cfg
in this part of the code base.
If this is all too much, please let me know. Thank you again! The code looks great otherwise.
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.
I can definitely try. If I need help along the way, I will ask on the slack channel.
All Times minikube: [ 68.167756 69.435963 64.223079] Average minikube: 67.275599 Averages Time Per Log
|
All Times minikube: [ 68.277951 66.968466 65.261791] Average minikube: 66.836069 Averages Time Per Log
|
All Times minikube: [ 67.952134 63.561334 64.747868] Average minikube: 65.420445 Averages Time Per Log
|
Need any help with this PR? |
No, I think I am good for now. The multi-node PR was merged which has created some merge conflicts. I am trying to resolve those conflicts. I will reach out for help if I get stuck. Thanks! :) |
All Times Minikube (PR 7105): [ 69.496254 70.614402 71.053381] Average minikube: 69.627776 Averages Time Per Log
|
Looks great. Thank you! |
Thank you for your help! |
fixes #7092