Skip to content
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

Merged
merged 25 commits into from
Feb 14, 2020
Merged

Conversation

sharifelgamal
Copy link
Collaborator

@sharifelgamal sharifelgamal commented Feb 8, 2020

Fixes #6300

Also refactors minikube start and minikube stop

@sharifelgamal sharifelgamal changed the title Create the Node subcommands WIP: Create the Node subcommands Feb 8, 2020
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 8, 2020
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2020
@k8s-ci-robot k8s-ci-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 11, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 11, 2020
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 11, 2020
Copy link
Contributor

@tstromberg tstromberg left a 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.

@@ -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))
Copy link
Contributor

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.

@@ -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)
Copy link
Contributor

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()

)

// 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) {
Copy link
Contributor

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
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 12, 2020
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Feb 13, 2020
@sharifelgamal sharifelgamal changed the title WIP: Create the Node subcommands Create the Node subcommands Feb 13, 2020
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 13, 2020
@medyagh
Copy link
Member

medyagh commented Feb 13, 2020

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Feb 13, 2020
@minikube-pr-bot
Copy link

Error: running mkcmp: exit status 1

@medyagh
Copy link
Member

medyagh commented Feb 13, 2020

the integration tests look good !!!!

@medyagh
Copy link
Member

medyagh commented Feb 13, 2020

only test that looks a bit suspectious is TestVersionUpgrade that fails across all of them

@codecov-io
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (master@8c55c9c). Click here to learn what that means.
The diff coverage is 14.28%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #6556   +/-   ##
=========================================
  Coverage          ?   38.52%           
=========================================
  Files             ?      142           
  Lines             ?     8603           
  Branches          ?        0           
=========================================
  Hits              ?     3314           
  Misses            ?     4875           
  Partials          ?      414
Impacted Files Coverage Δ
pkg/minikube/driver/driver_linux.go 0% <ø> (ø)
pkg/minikube/command/kic_runner.go 0% <0%> (ø)
pkg/minikube/driver/driver.go 57.5% <0%> (ø)
cmd/minikube/cmd/kubectl.go 0% <0%> (ø)
pkg/minikube/machine/fix.go 32.33% <0%> (ø)
pkg/minikube/machine/start.go 51.23% <0%> (ø)
pkg/minikube/cluster/ip.go 0% <0%> (ø)
cmd/minikube/cmd/start.go 32.87% <0%> (ø)
pkg/minikube/machine/cache_images.go 0% <0%> (ø)
pkg/minikube/machine/client.go 43.84% <0%> (ø)
... and 4 more

@minikube-pr-bot
Copy link

All Times minikube: [ 94.593679 94.446244 92.649031]
All Times Minikube (PR 6556): [ 93.824419 90.321647 95.728519]

Average minikube: 93.896318
Average Minikube (PR 6556): 93.291529

Averages Time Per Log

+----------------------+-----------+--------------------+
|         LOG          | MINIKUBE  | MINIKUBE (PR 6556) |
+----------------------+-----------+--------------------+
| minikube v           |  0.196925 |           0.203300 |
| Creating kvm2        | 20.016630 |          20.187398 |
| Preparing Kubernetes | 50.884715 |          50.866796 |
| Pulling images       |           |                    |
| Launching Kubernetes | 21.084867 |          20.351941 |
| Waiting for cluster  |  0.042750 |           0.068516 |
+----------------------+-----------+--------------------+

Copy link
Contributor

@tstromberg tstromberg left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create Node operations for multinode
6 participants