8000 Create the Node subcommands by sharifelgamal · Pull Request #6556 · kubernetes/minikube · GitHub
[go: up one dir, main page]

Skip to content

Create the Node subcommands - #6556

Merged
sharifelgamal merged 25 commits into
kubernetes:masterfrom
sharifelgamal:node-pkg
Feb 14, 2020
Merged

sharifelgamal merged 25 commits into
kubernetes:masterfrom
sharifelgamal:node-pkg

Conversation

@sharifelgamal
@sharifelgamal sharifelgamal commented Feb 8, 2020 •
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

Details 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
@tstromberg tstromberg left a comment
Copy link
Copy Markdown
Contributor

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.

8000
Comment thread cmd/minikube/cmd/logs.go Outdated
exit.WithError("command runner", err)
}
bs, err := getClusterBootstrapper(api, viper.GetString(cmdcfg.Bootstrapper))
bs, err := node.Bootstrapper(api, viper.GetString(cmdcfg.Bootstrapper))
Copy link
Copy Markdown
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.

Comment thread cmd/minikube/cmd/stop.go Outdated
nonexistent := false
stop := func() (err error) {
err = cluster.StopHost(api)
err = cluster.StopHost(api, profile)
Copy link
Copy Markdown
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()

Comment thread 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) {
Copy link
Copy Markdown
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
Copy Markdown
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
medyagh commented Feb 13, 2020
Copy link
Copy Markdown
Member

/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
Copy Markdown

Error: running mkcmp: exit status 1

@medyagh
medyagh commented Feb 13, 2020
Copy link
Copy Markdown
Member

the integration tests look good !!!!

@medyagh
medyagh commented Feb 13, 2020
Copy link
Copy Markdown
Member

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

@codecov-io
Copy link
Copy Markdown

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
Copy Markdown

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 |
+----------------------+-----------+--------------------+

@tstromberg tstromberg left a comment
Copy link
Copy Markdown
Contributor

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

0