-
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
WIP: Add minikube support for the "generic" VM driver #9545
Closed
Closed
Changes from 17 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
264072b
Add minikube support for the "generic" VM driver
afbjorklund 63e6c66
Don't download ISO for the generic VM driver
afbjorklund d8712cd
Generic driver does not add user to docker group
afbjorklund 19918ca
Try to uninstall kubernetes on delete, for generic
afbjorklund d53a0d3
Don't try to start/stop drivers without VMs
afbjorklund 71e9dc1
Flip the driver logic to make code easier to read
afbjorklund d35d00c
Allow actually using the generic driver
afbjorklund 55e8e33
Call DetectProvisioner for the generic driver
afbjorklund 4197935
Show remote host info and proper progress
afbjorklund dc08bd8
Fix failing unit test for MachineType
afbjorklund 9e7739e
Log the os-release also for the generic driver
afbjorklund 3b594c3
Need to set up docker group in start - not in fix
afbjorklund be770af
Also parse the available, in addition to the total
afbjorklund e1effd3
Add some error checking on the parsed data fields
afbjorklund b17ecbd
Convert the return values to use uint64 instead
afbjorklund 88df534
Supply the disk mountpoint as a parameter instead
afbjorklund 2394e33
Merge branch 'master' into generic
afbjorklund 251ee84
Merge branch 'master' into generic
afbjorklund 6104fb9
fixup: out.T was renamed to out.Step
afbjorklund 3bb75da
Revert "Supply the disk mountpoint as a parameter instead"
afbjorklund bb53864
Revert "Convert the return values to use uint64 instead"
afbjorklund 612606c
Revert "Add some error checking on the parsed data fields"
afbjorklund 08e1a65
Revert "Also parse the available, in addition to the total"
afbjorklund 4428b3b
Revert "Show remote host info and proper progress"
afbjorklund 70d1a31
Add helper for checking the generic driver name
afbjorklund 1dc8769
Merge branch 'master' into generic
afbjorklund 306d08d
Merge branch 'master' into generic
afbjorklund 31ccaa6
Merge branch 'master' into generic
afbjorklund 1369b08
Merge branch 'master' into generic
afbjorklund File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
/* | ||
Copyright 2019 The Kubernetes Authors All rights reserved. | ||
|
||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package generic | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/docker/machine/drivers/generic" | ||
"github.com/docker/machine/libmachine/drivers" | ||
"github.com/pkg/errors" | ||
|
||
"k8s.io/minikube/pkg/minikube/config" | ||
"k8s.io/minikube/pkg/minikube/driver" | ||
"k8s.io/minikube/pkg/minikube/localpath" | ||
"k8s.io/minikube/pkg/minikube/registry" | ||
) | ||
|
||
func init() { | ||
err := registry.Register(registry.DriverDef{ | ||
Name: driver.Generic, | ||
Config: configure, | ||
Status: status, | ||
Priority: registry.Fallback, | ||
Init: func() drivers.Driver { return generic.NewDriver("", "") }, | ||
}) | ||
if err != nil { | ||
panic(fmt.Sprintf("unable to register: %v", err)) | ||
} | ||
} | ||
|
||
func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) { | ||
d := generic.NewDriver(driver.MachineName(cc, n), localpath.MiniPath()) | ||
|
||
if cc.GenericIPAddress == "" { | ||
return nil, errors.Errorf("please provide an IP address") | ||
} | ||
|
||
d.(*generic.Driver).IPAddress = cc.GenericIPAddress | ||
d.(*generic.Driver).SSHUser = cc.GenericSSHUser | ||
d.(*generic.Driver).SSHKey = cc.GenericSSHKey | ||
d.(*generic.Driver).SSHPort = cc.GenericSSHPort | ||
|
||
return d, nil | ||
} | ||
|
||
func status() registry.State { | ||
return registry.State{Installed: true, Healthy: true} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We should validate that all of these flags are set and exit with a helpful error message if the user has forgotten anything
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 did that, but it was lost during the rebase. It should at least give an error if forgetting to provide an IP address ?
The other parameters are optional, by default it will connect as root on port 22 and assume keys are in ssh-agent