-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Bundle localkube in the minikube binary as a blob, send that to the VM. #66
Conversation
Also cleanup the Makefile quite a bit. We not build localkube in docker on mac, then use go-bindata to pack it up. Users will need go-bindata on their paths to build now, though.
@@ -25,3 +25,5 @@ _testmain.go | |||
|
|||
/out | |||
/.gopath | |||
|
|||
pkg/minikube/cluster/localkubecontents.go |
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: newline
- Install go-bindata automatically. - Newlines - Change to Go 1.6.
fmt.Fprint(w, "\x00") | ||
}() | ||
|
||
scpcmd := fmt.Sprintf("sudo /usr/local/bin/scp -t %s", remotedir) |
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.
What about if scp
is located in another location?
Maybe use a shell or query which scp
first.
(This isn't so important...)
@@ -154,6 +156,24 @@ func StartCluster(h sshAble, config KubernetesConfig) error { | |||
return nil | |||
} | |||
|
|||
func UpdateCluster(d drivers.Driver) error { | |||
localkube, err := Asset("out/localkube") |
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.
Maybe move this to some constant? So we have only one place to update if we change the path in the future
This LGTM. Merging to move forward |
Ah, wait. Travis returned false information again.
|
Ah whoops, I think I got it this time. |
cp $(BUILD_DIR)/localkube-$(GOOS)-$(GOARCH) $(BUILD_DIR)/localkube | ||
out/localkube: .gopath | ||
ifeq ($(GOOS),linux) | ||
CGO_ENABLED=1 go build -v -ldflags="-s" -o $(BUILD_DIR)/localkube ./cmd/localkube |
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.
The -v
here makes it very verbose all the time.
Maybe add a VERBOSE
flag to the makefile so we may control it?
I may do this later as well.
Seems like a |
Had to add the generated file and the .gopath directory to the whitelist. Let's see if we get farther this time. |
LGTM, merging... |
This PR changes the Makefile a bit to do proper dependency management.
It now builds localkube (via docker on Mac) before the minikube build, then packs it using go-bindata. Minikube uses native scp to transfer this file into the VM, and starts that binary instead of downloading it over the internet.
cc @luxas