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

Remove all minikube dependencies from drivers #4933

Merged
merged 16 commits into from
Aug 12, 2019

Conversation

sharifelgamal
Copy link
Collaborator

@sharifelgamal sharifelgamal commented Jul 31, 2019

All the config not related to networking gets overridden in the config passed in from the client, so there's never a need to set any defaults.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 31, 2019
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 31, 2019
@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 Jul 31, 2019
@sharifelgamal sharifelgamal requested review from josedonizetti and removed request for RA489 July 31, 2019 21:47
@@ -121,7 +117,7 @@ func (d *Driver) Create() error {

// DriverName returns the name of the driver
func (d *Driver) DriverName() string {
return constants.DriverHyperkit
return "hyperkit"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make it a constant inside the driver?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree :-P

@@ -224,7 +214,7 @@ func (d *Driver) GetSSHHostname() (string, error) {

// DriverName returns the name of the driver
func (d *Driver) DriverName() string {
return constants.DriverKvm2
return "kvm2"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make it a constant inside the driver?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, done.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@afbjorklund As those are the driver names I consider they good for a constant. To always have only one place to change it, even though now we don't have many. But as always, no strong feelings. and probably a too simple thing to start a big discussion, so all good to revert it to string only :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, at least it's not using the constants module. But the string is only used in 1 or 2 places ?

It's the not the most important thing, just thought it was an unnecessary step of indirection.

}
return nil
if err.Error() != fmt.Sprintf(IPErrorMessage, mac) {
Copy link
Member

@josedonizetti josedonizetti Jul 31, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, do you think it's worth having a custom error and compare the type? comparing error strings seems ugly :/

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I wasn't wild about text parsing either, and the custom error type is easy to add. done.

@@ -52,6 +49,7 @@ const (
permErr = "%s needs to run with elevated permissions. " +
"Please run the following command, then try again: " +
"sudo chown root:wheel %s && sudo chmod u+s %s"
driverHyperkit = "hyperkit"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just use the string?

@@ -91,6 +87,7 @@ const (
qemusystem = "qemu:///system"
defaultPrivateNetworkName = "minikube-net"
defaultNetworkName = "default"
driverKvm2 = "kvm2"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or just use the string ?

@@ -224,7 +215,7 @@ func (d *Driver) GetSSHHostname() (string, error) {

// DriverName returns the name of the driver
func (d *Driver) DriverName() string {
return constants.DriverKvm2
return driverKvm2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"kvm2"

@@ -121,7 +118,7 @@ func (d *Driver) Create() error {

// DriverName returns the name of the driver
func (d *Driver) DriverName() string {
return constants.DriverHyperkit
return driverHyperkit
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"hyperkit"

@@ -78,7 +80,7 @@ func getIPAddressFromFile(mac, path string) (string, error) {
return dhcpEntry.IPAddress, nil
}
}
return "", fmt.Errorf("could not find an IP address for %s", mac)
return "", fmt.Errorf(IPErrorMessage, mac)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would prefer having the printf inline here

@@ -121,7 +117,7 @@ func (d *Driver) Create() error {

// DriverName returns the name of the driver
func (d *Driver) DriverName() string {
return constants.DriverHyperkit
return "hyperkit"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree :-P

@afbjorklund
Copy link
Collaborator

afbjorklund commented Aug 1, 2019

All the config not related to networking gets overridden in the config passed in from the client, so there's never a need to set any defaults.

I find this strange, since normally it does have some defaults. But I guess we will see, once it has been tried stand-alone (with docker-machine)

Then again, those defaults are usually 1 CPU and 1G RAM - since that is what Docker requires.

It is Kubernetes that is increasing that to 2 CPU and 2G RAM, or maybe I should say kubeadm does.

@afbjorklund
Copy link
Collaborator

This addresses the dependencies found in #4909, but seems like it doesn't build just yet.

# k8s.io/minikube/pkg/drivers/hyperkit
pkg/drivers/hyperkit/driver.go:269:12: undefined: TempError
pkg/drivers/hyperkit/driver.go:280:18: impossible type assertion:
	*tempError does not implement error (missing Error method)

@sharifelgamal sharifelgamal changed the title Remove all minikube dependencies from drivers WIP: Remove all minikube dependencies from drivers Aug 2, 2019
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 2, 2019
@sharifelgamal sharifelgamal changed the title WIP: Remove all minikube dependencies from drivers Remove all minikube dependencies from drivers Aug 6, 2019
@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 Aug 6, 2019
@sharifelgamal
Copy link
Collaborator Author

@minikube-bot OK to test

@sharifelgamal
Copy link
Collaborator Author

This should be ready now.

@afbjorklund
Copy link
Collaborator

Why revert the libmachine version ?

Moving back to the 0.16.1 version re-introduces the AMD bug (yet again)

@sharifelgamal
Copy link
Collaborator Author

It was causing issues with go modules, and specifically with the go proxy:
curl https://proxy.golang.org/github.com/docker/machine/@v/v0.16.1-0.20190718054102-a555e4f7a8f5.info not found: github.com/docker/[email protected]: invalid pseudo-version: revision a555e4f7a8f5 is not a descendent of preceding tag (v0.16.0)

I didn't realize that reverting back to the release tag reintroduces a bug, I'll looking into pinning this correctly.

@afbjorklund
Copy link
Collaborator

afbjorklund commented Aug 8, 2019

It was causing issues with go modules, and specifically with the go proxy:

No worries, it was my fault for hacking the version. I'll go back to the weirdo v0.0.0

#4817 (comment)

Or maybe it is even worse than v0.0.0: v0.7.1-0.20190718054102-a555e4f7a8f5
Since machine doesn't tag on master, and doesn't start the tags with a silent v.

https://golang.org/cmd/go/#hdr-Pseudo_versions

So go just imagines some weird version like 0.7.1 (that never existed! it's 0.8.0),
since v0.7.0 was tagged on master - it just adds one and hopes for the best. 😠

@afbjorklund
Copy link
Collaborator

@sharifelgamal : why aren't we messing with go proxy (and Travis) in a separate PR ?

@sharifelgamal
Copy link
Collaborator Author

You're right, it should be a separate PR. The travis issues were causing tests to fail in this PR so I was testing solutions. I'll open a new PR.

@afbjorklund
Copy link
Collaborator

afbjorklund commented Aug 8, 2019

I can fix the go.mod, in order to make go proxy happy (have never tried go proxy)

	github.com/docker/machine v0.7.1-0.20190718054102-a555e4f7a8f5

@sharifelgamal
Copy link
Collaborator Author

#5018 is the new go proxy PR

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 10, 2019
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 12, 2019
@sharifelgamal sharifelgamal merged commit a817bff into kubernetes:master Aug 12, 2019
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. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants