-
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
Create the Node subcommands #6556
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sharifelgamal The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
Minor nits to note the obviously incomplete parts, but it looks great and safely mergeable.
cmd/minikube/cmd/logs.go
Outdated
@@ -66,7 +67,7 @@ var logsCmd = &cobra.Command{ | |||
if err != nil { | |||
exit.WithError("command runner", err) | |||
} | |||
bs, err := getClusterBootstrapper(api, viper.GetString(cmdcfg.Bootstrapper)) | |||
bs, err := node.Bootstrapper(api, viper.GetString(cmdcfg.Bootstrapper)) |
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.
This placement feels a bit weird: the bootstrapper is a cluster-property rather than a node property.
cmd/minikube/cmd/stop.go
Outdated
@@ -53,15 +53,15 @@ func runStop(cmd *cobra.Command, args []string) { | |||
|
|||
nonexistent := false | |||
stop := func() (err error) { | |||
err = cluster.StopHost(api) | |||
err = cluster.StopHost(api, profile) |
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.
This should probably be node.Stop() or cluster.Stop()
pkg/minikube/node/start.go
Outdated
) | ||
|
||
// Start spins up a guest and starts the kubernetes node. | ||
func Start(mc *config.MachineConfig, n *config.Node, primary bool, existingAddons map[string]bool) (*kubeconfig.Settings, error) { |
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.
Unless this is altering the contents of mc & n, consider passing in values rather than pointers.
"Don't pass pointers as function arguments just to save a few bytes. If a function refers to its argument x only as *x throughout, then the argument shouldn't be a pointer."
showVersionInfo(k8sVersion, cr) | ||
waitCacheRequiredImages(&cacheGroup) | ||
|
||
// Must be written before bootstrap, otherwise health checks may flake due to stale IP |
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.
Feel free to do this later, but kubeconfig (and other bits of this function) is on a cluster level rather than a node level.
/ok-to-test |
Error: running mkcmp: exit status 1 |
the integration tests look good !!!! |
only test that looks a bit suspectious is TestVersionUpgrade that fails across all of them |
Codecov Report
@@ Coverage Diff @@
## master #6556 +/- ##
=========================================
Coverage ? 38.52%
=========================================
Files ? 142
Lines ? 8603
Branches ? 0
=========================================
Hits ? 3314
Misses ? 4875
Partials ? 414
|
All Times minikube: [ 94.593679 94.446244 92.649031] Average minikube: 93.896318 Averages Time Per Log
|
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.
Good god this is an awesome refactor. Ship it!
Fixes #6300
Also refactors
minikube start
andminikube stop