-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
CLI param to proxy minikube's options #485
Conversation
/test pull-cluster-api-test |
@@ -28,14 +28,15 @@ import ( | |||
type Minikube struct { | |||
kubeconfigpath string | |||
vmDriver string | |||
options []string |
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.
please run gofmt on this file.
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.
yup, will do!
@@ -28,14 +28,15 @@ import ( | |||
type Minikube struct { | |||
kubeconfigpath string | |||
vmDriver string |
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.
should vmDriver be removed (is it being replaced by options)?
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.
Agreed!
// minikubeExec implemented as function variable for testing hooks | ||
minikubeExec func(env []string, args ...string) (string, error) | ||
} | ||
|
||
func New(vmDriver string) *Minikube { | ||
func New(options []string) *Minikube { |
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.
If these are purely optional, it would be nice to make them optional. Maybe two constructors: New()
and WithOptions(options []string)
would make more sense (and make the test code easier to read)?
Client code would look like either m := minikube.New()
or m := minikube.WithOptions([]string{"vm-driver=kvm2"})
which I think would be easier to read than m := New([]string{})
.
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.
TBH, I don't mind either way so I'll go with whatever you guys reckon is best. 👍
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.
Let's go with two constructors. We might only end up using the WithOptions
one in the normal code, but it'll make the test code look a lot nicer.
/assign @roberthbailey |
@flaper87 - are you planning to finish this PR? |
@roberthbailey yep, I am. Sorry, just had a couple of travel weeks. |
@flaper87 - no worries, just wanted to make sure it should still be open while doing some PR backlog grooming. |
@flaper87 - can you rebase this so that we can merge it? |
@roberthbailey done! thanks for the heads up |
cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube_test.go
Outdated
Show resolved
Hide resolved
cmd/clusterctl/clusterdeployer/bootstrap/minikube/minikube_test.go
Outdated
Show resolved
Hide resolved
d16bce5
to
5f27cd8
Compare
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 you run gofmt
on the modified files? It looks like a bunch of them have incorrect indentation.
@@ -27,15 +27,19 @@ import ( | |||
|
|||
type Minikube struct { | |||
kubeconfigpath string | |||
vmDriver string | |||
options []string |
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.
nit: is this go fmted?
@Lion-Wei @roberthbailey bah, thought I had run it. I did now, thanks for the review 😄 |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: flaper87, roberthbailey 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 |
What this PR does / why we need it:
clusterctl
exposes a couple of theminikube
CLI params, which is useful. Unfortunately, it still hides other params that may be essential. For example, it's currently not possible to set theinsecure-registry
option throughclusterctl
, which is quite important for development.This PR proposes a new CLI param for
clusterctl
that acts as a proxy for theminikube
CLI params. This approach makes the interface/interaction betweenclusterctl
andminikube
easier to maintain.I realize there's a wish to make
clusterctl
more generic (not minikube dependant) and for that purpose, we could rename the--minikube
CLI param to something more generic--deployer-params
.