-
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
Remove all minikube dependencies from drivers #4933
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 |
@@ -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" |
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.
can we make it a constant inside the driver?
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.
yep, done.
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 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" |
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.
can we make it a constant inside the driver?
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.
yep, done.
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.
But why
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.
@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 :)
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.
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.
pkg/drivers/hyperkit/driver.go
Outdated
} | ||
return nil | ||
if err.Error() != fmt.Sprintf(IPErrorMessage, mac) { |
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.
hey, do you think it's worth having a custom error and compare the type? comparing error strings seems ugly :/
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.
yeah I wasn't wild about text parsing either, and the custom error type is easy to add. done.
pkg/drivers/hyperkit/driver.go
Outdated
@@ -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" |
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.
or just use the string?
pkg/drivers/kvm/kvm.go
Outdated
@@ -91,6 +87,7 @@ const ( | |||
qemusystem = "qemu:///system" | |||
defaultPrivateNetworkName = "minikube-net" | |||
defaultNetworkName = "default" | |||
driverKvm2 = "kvm2" |
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.
or just use the string ?
pkg/drivers/kvm/kvm.go
Outdated
@@ -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 |
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.
"kvm2"
pkg/drivers/hyperkit/driver.go
Outdated
@@ -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 |
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.
"hyperkit"
pkg/drivers/hyperkit/network.go
Outdated
@@ -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) |
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.
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" |
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 disagree :-P
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 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. |
This addresses the dependencies found in #4909, but seems like it doesn't build just yet.
|
@minikube-bot OK to test |
This should be ready now. |
Why revert the libmachine version ? Moving back to the 0.16.1 version re-introduces the AMD bug (yet again) |
It was causing issues with go modules, and specifically with the go proxy: I didn't realize that reverting back to the release tag reintroduces a bug, I'll looking into pinning this correctly. |
No worries, it was my fault for hacking the version. I'll go back to the weirdo Or maybe it is even worse than 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), |
@sharifelgamal : why aren't we messing with go proxy (and Travis) in a separate PR ? |
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. |
I can fix the go.mod, in order to make go proxy happy (have never tried go proxy)
|
#5018 is the new go proxy PR |
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.