Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
79ccf7ae
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,发现更多精彩内容 >>
未验证
提交
79ccf7ae
编写于
4月 25, 2019
作者:
S
Sharif Elgamal
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of github.com:kubernetes/minikube into error-messages
上级
28211001
3ebb16c6
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
36 addition
and
20 deletion
+36
-20
cmd/minikube/cmd/start.go
cmd/minikube/cmd/start.go
+9
-5
pkg/minikube/cluster/cluster.go
pkg/minikube/cluster/cluster.go
+0
-6
test/integration/tunnel_test.go
test/integration/tunnel_test.go
+27
-9
未找到文件。
cmd/minikube/cmd/start.go
浏览文件 @
79ccf7ae
...
...
@@ -176,11 +176,17 @@ func runStart(cmd *cobra.Command, args []string) {
exit
.
WithError
(
"Failed to generate config"
,
err
)
}
if
viper
.
GetString
(
vmDriver
)
==
constants
.
DriverNone
{
// Optimization: images will be persistently loaded into the host's container runtime, so no need to duplicate work.
// For non-"none", the ISO is required to boot, so block until it is downloaded
if
viper
.
GetString
(
vmDriver
)
!=
constants
.
DriverNone
{
if
err
:=
cluster
.
CacheISO
(
config
.
MachineConfig
);
err
!=
nil
{
exit
.
WithError
(
"Failed to cache ISO"
,
err
)
}
}
else
{
// With "none", images are persistently stored in Docker, so internal caching isn't necessary.
viper
.
Set
(
cacheImages
,
false
)
}
// Now that the ISO is downloaded, pull images in the background while the VM boots.
var
cacheGroup
errgroup
.
Group
beginCacheImages
(
&
cacheGroup
,
k8sVersion
)
...
...
@@ -195,10 +201,8 @@ func runStart(cmd *cobra.Command, args []string) {
exit
.
WithError
(
"Failed to get machine client"
,
err
)
}
// If --download-only, complete the remaining downloads and exit.
if
viper
.
GetBool
(
downloadOnly
)
{
if
err
:=
cluster
.
CacheISO
(
config
.
MachineConfig
);
err
!=
nil
{
exit
.
WithError
(
"Failed to cache ISO"
,
err
)
}
if
err
:=
doCacheBinaries
(
k8sVersion
);
err
!=
nil
{
exit
.
WithError
(
"Failed to cache binaries"
,
err
)
}
...
...
pkg/minikube/cluster/cluster.go
浏览文件 @
79ccf7ae
...
...
@@ -301,13 +301,7 @@ func createHost(api libmachine.API, config cfg.MachineConfig) (*host.Host, error
exit
.
WithError
(
"error getting driver"
,
err
)
}
err
=
CacheISO
(
config
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"unable to cache ISO"
)
}
driver
:=
def
.
ConfigCreator
(
config
)
data
,
err
:=
json
.
Marshal
(
driver
)
if
err
!=
nil
{
return
nil
,
errors
.
Wrap
(
err
,
"marshal"
)
...
...
test/integration/tunnel_test.go
浏览文件 @
79ccf7ae
...
...
@@ -27,6 +27,8 @@ import (
"testing"
"time"
"k8s.io/apimachinery/pkg/util/wait"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/minikube/pkg/minikube/tunnel"
...
...
@@ -76,7 +78,7 @@ func testTunnel(t *testing.T) {
t
.
Fatal
(
errors
.
Wrap
(
err
,
"waiting for nginx pods"
))
}
if
err
:=
commonutil
.
WaitForService
(
client
,
"default"
,
"nginx-svc"
,
true
,
time
.
Millisecond
*
500
,
time
.
Minute
*
10
);
err
!=
nil
{
if
err
:=
commonutil
.
WaitForService
(
client
,
"default"
,
"nginx-svc"
,
true
,
1
*
time
.
Second
,
2
*
time
.
Minute
);
err
!=
nil
{
t
.
Fatal
(
errors
.
Wrap
(
err
,
"Error waiting for nginx service to be up"
))
}
...
...
@@ -84,18 +86,34 @@ func testTunnel(t *testing.T) {
nginxIP
:=
""
for
i
:=
1
;
i
<
3
&&
len
(
nginxIP
)
==
0
;
i
++
{
stdout
,
err
:=
kubectlRunner
.
RunCommand
([]
string
{
"get"
,
"svc"
,
"nginx-svc"
,
"-o"
,
"jsonpath={.status.loadBalancer.ingress[0].ip}"
})
if
err
!=
nil
{
t
.
Fatalf
(
"error listing nginx service: %s"
,
err
)
err
=
wait
.
PollImmediate
(
1
*
time
.
Second
,
1
*
time
.
Minute
,
func
()
(
bool
,
error
)
{
cmd
:=
[]
string
{
"get"
,
"svc"
,
"nginx-svc"
,
"-o"
,
"jsonpath={.status.loadBalancer.ingress[0].ip}"
}
stdout
,
err
:=
kubectlRunner
.
RunCommand
(
cmd
)
switch
{
case
err
==
nil
:
nginxIP
=
string
(
stdout
)
return
len
(
stdout
)
!=
0
,
nil
case
!
commonutil
.
IsRetryableAPIError
(
err
)
:
t
.
Errorf
(
"`%s` failed with non retriable error: %v"
,
cmd
,
err
)
return
false
,
err
default
:
t
.
Errorf
(
"`%s` failed: %v"
,
cmd
,
err
)
return
false
,
nil
}
nginxIP
=
string
(
stdout
)
time
.
Sleep
(
1
*
time
.
Second
)
})
if
err
!=
nil
{
t
.
Errorf
(
"error getting ingress IP for nginx: %s"
,
err
)
}
if
len
(
nginxIP
)
==
0
{
t
.
Fatal
(
"svc should have ingress after tunnel is created, but it was empty!"
)
stdout
,
err
:=
kubectlRunner
.
RunCommand
([]
string
{
"get"
,
"svc"
,
"nginx-svc"
,
"-o"
,
"jsonpath={.status}"
})
if
err
!=
nil
{
t
.
Errorf
(
"error debugging nginx service: %s"
,
err
)
}
t
.
Fatalf
(
"svc should have ingress after tunnel is created, but it was empty! Result of `kubectl describe svc nginx-svc`:
\n
%s"
,
string
(
stdout
))
}
responseBody
,
err
:=
getResponseBody
(
nginxIP
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录