Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
a77e3de8
M
minikube
项目概览
Chu Peng 楚鹏
/
minikube
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
minikube
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a77e3de8
编写于
1月 06, 2021
作者:
A
Anders F Björklund
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Use CommonDrivers and drop machine GetCreateFlags
This makes the machine driver specific to minikube
上级
fa05fcd6
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
7 addition
and
42 deletion
+7
-42
pkg/drivers/generic/generic.go
pkg/drivers/generic/generic.go
+3
-38
pkg/minikube/registry/drvs/generic/generic.go
pkg/minikube/registry/drvs/generic/generic.go
+4
-4
未找到文件。
pkg/drivers/generic/generic.go
浏览文件 @
a77e3de8
...
...
@@ -28,13 +28,14 @@ import (
"github.com/docker/machine/libmachine/drivers"
"github.com/docker/machine/libmachine/engine"
"github.com/docker/machine/libmachine/log"
"github.com/docker/machine/libmachine/mcnflag"
"github.com/docker/machine/libmachine/mcnutils"
"github.com/docker/machine/libmachine/state"
pkgdrivers
"k8s.io/minikube/pkg/drivers"
)
type
Driver
struct
{
*
drivers
.
BaseDriver
*
pkgdrivers
.
CommonDriver
EnginePort
int
SSHKey
string
}
...
...
@@ -43,44 +44,8 @@ const (
defaultTimeout
=
15
*
time
.
Second
)
// GetCreateFlags registers the flags this driver adds to
// "docker hosts create"
func
(
d
*
Driver
)
GetCreateFlags
()
[]
mcnflag
.
Flag
{
return
[]
mcnflag
.
Flag
{
mcnflag
.
IntFlag
{
Name
:
"generic-engine-port"
,
Usage
:
"Docker engine port"
,
Value
:
engine
.
DefaultPort
,
EnvVar
:
"GENERIC_ENGINE_PORT"
,
},
mcnflag
.
StringFlag
{
Name
:
"generic-ip-address"
,
Usage
:
"IP Address of machine"
,
EnvVar
:
"GENERIC_IP_ADDRESS"
,
},
mcnflag
.
StringFlag
{
Name
:
"generic-ssh-user"
,
Usage
:
"SSH user"
,
Value
:
drivers
.
DefaultSSHUser
,
EnvVar
:
"GENERIC_SSH_USER"
,
},
mcnflag
.
StringFlag
{
Name
:
"generic-ssh-key"
,
Usage
:
"SSH private key path (if not provided, default SSH key will be used)"
,
Value
:
""
,
EnvVar
:
"GENERIC_SSH_KEY"
,
},
mcnflag
.
IntFlag
{
Name
:
"generic-ssh-port"
,
Usage
:
"SSH port"
,
Value
:
drivers
.
DefaultSSHPort
,
EnvVar
:
"GENERIC_SSH_PORT"
,
},
}
}
// NewDriver creates and returns a new instance of the driver
func
NewDriver
(
hostName
,
storePath
string
)
drivers
.
Driver
{
func
NewDriver
(
hostName
,
storePath
string
)
*
Driver
{
return
&
Driver
{
EnginePort
:
engine
.
DefaultPort
,
BaseDriver
:
&
drivers
.
BaseDriver
{
...
...
pkg/minikube/registry/drvs/generic/generic.go
浏览文件 @
a77e3de8
...
...
@@ -49,10 +49,10 @@ func configure(cc config.ClusterConfig, n config.Node) (interface{}, error) {
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
d
.
IPAddress
=
cc
.
GenericIPAddress
d
.
SSHUser
=
cc
.
GenericSSHUser
d
.
SSHKey
=
cc
.
GenericSSHKey
d
.
SSHPort
=
cc
.
GenericSSHPort
return
d
,
nil
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录