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

CLI param to proxy minikube's options #485

Merged
merged 1 commit into from
Oct 16, 2018

Conversation

flaper87
Copy link
Contributor

What this PR does / why we need it:

clusterctl exposes a couple of the minikube CLI params, which is useful. Unfortunately, it still hides other params that may be essential. For example, it's currently not possible to set the insecure-registry option through clusterctl, which is quite important for development.

This PR proposes a new CLI param for clusterctl that acts as a proxy for the minikube CLI params. This approach makes the interface/interaction between clusterctl and minikube 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.

New CLI param for clusterctl that proxies minikube arguments. Use `--minikube vm-driver=kvm2 --minikube insecure-registry=172.16.0.0/24'

@k8s-ci-robot k8s-ci-robot added 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. labels Aug 29, 2018
@flaper87
Copy link
Contributor Author

/test pull-cluster-api-test
/test pull-cluster-api-make

@@ -28,14 +28,15 @@ import (
type Minikube struct {
kubeconfigpath string
vmDriver string
options []string
Copy link
Contributor

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.

Copy link
Contributor Author

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

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

Copy link
Contributor Author

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

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{}).

Copy link
Contributor Author

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. 👍

Copy link
Contributor

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.

@roberthbailey
Copy link
Contributor

/assign @roberthbailey

@roberthbailey
Copy link
Contributor

@flaper87 - are you planning to finish this PR?

@flaper87
Copy link
Contributor Author

@roberthbailey yep, I am. Sorry, just had a couple of travel weeks.

@roberthbailey
Copy link
Contributor

@flaper87 - no worries, just wanted to make sure it should still be open while doing some PR backlog grooming.

@roberthbailey roberthbailey added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 5, 2018
@roberthbailey
Copy link
Contributor

@flaper87 - can you rebase this so that we can merge it?

@flaper87
Copy link
Contributor Author

@roberthbailey done! thanks for the heads up

@flaper87 flaper87 force-pushed the master branch 4 times, most recently from d16bce5 to 5f27cd8 Compare October 15, 2018 15:42
Copy link
Contributor

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

@roberthbailey roberthbailey removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Oct 15, 2018
@@ -27,15 +27,19 @@ import (

type Minikube struct {
kubeconfigpath string
vmDriver string
options []string

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?

@flaper87
Copy link
Contributor Author

@Lion-Wei @roberthbailey bah, thought I had run it. I did now, thanks for the review 😄

@roberthbailey
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 16, 2018
@k8s-ci-robot
Copy link
Contributor

[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 /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 Oct 16, 2018
@k8s-ci-robot k8s-ci-robot merged commit 19551f1 into kubernetes-sigs:master Oct 16, 2018
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. 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.

None yet

4 participants