Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
f33ac4c2
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,发现更多精彩内容 >>
提交
f33ac4c2
编写于
7月 20, 2020
作者:
S
Sharif Elgamal
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
regenerate config on retry
上级
bf387850
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
9 addition
and
7 deletion
+9
-7
cmd/minikube/cmd/node_add.go
cmd/minikube/cmd/node_add.go
+1
-1
cmd/minikube/cmd/node_start.go
cmd/minikube/cmd/node_start.go
+1
-1
cmd/minikube/cmd/start.go
cmd/minikube/cmd/start.go
+6
-4
cmd/minikube/cmd/start_flags.go
cmd/minikube/cmd/start_flags.go
+1
-1
未找到文件。
cmd/minikube/cmd/node_add.go
浏览文件 @
f33ac4c2
...
...
@@ -64,7 +64,7 @@ var nodeAddCmd = &cobra.Command{
}
if
err
:=
node
.
Add
(
cc
,
n
,
false
);
err
!=
nil
{
_
,
err
:=
maybeDeleteAndRetry
(
*
cc
,
n
,
nil
,
err
)
_
,
err
:=
maybeDeleteAndRetry
(
cc
,
n
,
nil
,
err
)
if
err
!=
nil
{
exit
.
WithError
(
"failed to add node"
,
err
)
}
...
...
cmd/minikube/cmd/node_start.go
浏览文件 @
f33ac4c2
...
...
@@ -69,7 +69,7 @@ var nodeStartCmd = &cobra.Command{
_
,
err
=
node
.
Start
(
s
,
false
)
if
err
!=
nil
{
_
,
err
:=
maybeDeleteAndRetry
(
*
cc
,
*
n
,
nil
,
err
)
_
,
err
:=
maybeDeleteAndRetry
(
cc
,
*
n
,
nil
,
err
)
if
err
!=
nil
{
node
.
MaybeExitWithAdvice
(
err
)
exit
.
WithError
(
"failed to start node"
,
err
)
...
...
cmd/minikube/cmd/start.go
浏览文件 @
f33ac4c2
...
...
@@ -282,7 +282,7 @@ func provisionWithDriver(cmd *cobra.Command, ds registry.DriverState, existing *
func
startWithDriver
(
starter
node
.
Starter
,
existing
*
config
.
ClusterConfig
)
(
*
kubeconfig
.
Settings
,
error
)
{
kubeconfig
,
err
:=
node
.
Start
(
starter
,
true
)
if
err
!=
nil
{
kubeconfig
,
err
=
maybeDeleteAndRetry
(
*
starter
.
Cfg
,
*
starter
.
Node
,
starter
.
ExistingAddons
,
err
)
kubeconfig
,
err
=
maybeDeleteAndRetry
(
starter
.
Cfg
,
*
starter
.
Node
,
starter
.
ExistingAddons
,
err
)
if
err
!=
nil
{
return
nil
,
err
}
...
...
@@ -411,7 +411,7 @@ func showKubectlInfo(kcs *kubeconfig.Settings, k8sVersion string, machineName st
return
nil
}
func
maybeDeleteAndRetry
(
cc
config
.
ClusterConfig
,
n
config
.
Node
,
existingAddons
map
[
string
]
bool
,
originalErr
error
)
(
*
kubeconfig
.
Settings
,
error
)
{
func
maybeDeleteAndRetry
(
cc
*
config
.
ClusterConfig
,
n
config
.
Node
,
existingAddons
map
[
string
]
bool
,
originalErr
error
)
(
*
kubeconfig
.
Settings
,
error
)
{
if
viper
.
GetBool
(
deleteOnFailure
)
{
out
.
WarningT
(
"Node {{.name}} failed to start, deleting and trying again."
,
out
.
V
{
"name"
:
n
.
Name
})
// Start failed, delete the cluster and try again
...
...
@@ -425,15 +425,17 @@ func maybeDeleteAndRetry(cc config.ClusterConfig, n config.Node, existingAddons
out
.
WarningT
(
"Failed to delete cluster {{.name}}, proceeding with retry anyway."
,
out
.
V
{
"name"
:
cc
.
Name
})
}
// Re-generate the cluster config, just in case the failure was related to an old config format
upgradeExistingConfig
(
cc
)
var
kubeconfig
*
kubeconfig
.
Settings
for
_
,
n
:=
range
cc
.
Nodes
{
r
,
p
,
m
,
h
,
err
:=
node
.
Provision
(
&
cc
,
&
n
,
n
.
ControlPlane
,
false
)
r
,
p
,
m
,
h
,
err
:=
node
.
Provision
(
cc
,
&
n
,
n
.
ControlPlane
,
false
)
s
:=
node
.
Starter
{
Runner
:
r
,
PreExists
:
p
,
MachineAPI
:
m
,
Host
:
h
,
Cfg
:
&
cc
,
Cfg
:
cc
,
Node
:
&
n
,
ExistingAddons
:
existingAddons
,
}
...
...
cmd/minikube/cmd/start_flags.go
浏览文件 @
f33ac4c2
...
...
@@ -217,7 +217,7 @@ func ClusterFlagValue() string {
// generateClusterConfig generate a config.ClusterConfig based on flags or existing cluster config
func
generateClusterConfig
(
cmd
*
cobra
.
Command
,
existing
*
config
.
ClusterConfig
,
k8sVersion
string
,
drvName
string
)
(
config
.
ClusterConfig
,
config
.
Node
,
error
)
{
var
cc
config
.
ClusterConfig
if
existing
!=
nil
{
// create profile config first time
if
existing
!=
nil
{
cc
=
updateExistingConfigFromFlags
(
cmd
,
existing
)
}
else
{
glog
.
Info
(
"no existing cluster config was found, will generate one from the flags "
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录