Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
f22a3633
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,发现更多精彩内容 >>
提交
f22a3633
编写于
4月 14, 2020
作者:
M
Medya Gh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add shut down to stop
上级
892162d1
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
13 addition
and
5 deletion
+13
-5
pkg/drivers/kic/oci/types.go
pkg/drivers/kic/oci/types.go
+2
-0
pkg/minikube/machine/delete.go
pkg/minikube/machine/delete.go
+2
-2
pkg/minikube/machine/stop.go
pkg/minikube/machine/stop.go
+9
-3
未找到文件。
pkg/drivers/kic/oci/types.go
浏览文件 @
f22a3633
...
...
@@ -31,6 +31,8 @@ const (
nodeRoleLabelKey
=
"role.minikube.sigs.k8s.io"
// CreatedByLabelKey is applied to any container/volume that is created by minikube created_by.minikube.sigs.k8s.io=true
CreatedByLabelKey
=
"created_by.minikube.sigs.k8s.io"
// ShutDownCmd is the command halt and stop the container
ShutDownCmd
=
"sudo init 0"
)
// CreateParams are parameters needed to create a container
...
...
pkg/minikube/machine/delete.go
浏览文件 @
f22a3633
...
...
@@ -77,8 +77,8 @@ func DeleteHost(api libmachine.API, machineName string) error {
return
mcnerror
.
ErrHostDoesNotExist
{
Name
:
machineName
}
}
//
Hyper-V requires special care to avoid ACPI and file locking issues
if
host
.
Driver
.
DriverName
()
==
driver
.
HyperV
{
//
some drivers need manual shut down before delete to avoid getting stuck.
if
driver
.
NeedsShutdown
(
host
.
Driver
.
DriverName
())
{
if
err
:=
StopHost
(
api
,
machineName
);
err
!=
nil
{
glog
.
Warningf
(
"stop host: %v"
,
err
)
}
...
...
pkg/minikube/machine/stop.go
浏览文件 @
f22a3633
...
...
@@ -25,6 +25,7 @@ import (
"github.com/docker/machine/libmachine/state"
"github.com/golang/glog"
"github.com/pkg/errors"
"k8s.io/minikube/pkg/drivers/kic/oci"
"k8s.io/minikube/pkg/minikube/driver"
"k8s.io/minikube/pkg/minikube/out"
"k8s.io/minikube/pkg/util/retry"
...
...
@@ -78,8 +79,13 @@ func trySSHPowerOff(h *host.Host) error {
}
out
.
T
(
out
.
Shutdown
,
`Powering off "{{.profile_name}}" via SSH ...`
,
out
.
V
{
"profile_name"
:
h
.
Name
})
out
,
err
:=
h
.
RunSSHCommand
(
"sudo poweroff"
)
// poweroff always results in an error, since the host disconnects.
glog
.
Infof
(
"poweroff result: out=%s, err=%v"
,
out
,
err
)
if
driver
.
IsKIC
(
h
.
DriverName
)
{
out
,
err
:=
h
.
RunSSHCommand
(
oci
.
ShutDownCmd
)
glog
.
Infof
(
"shutdown cmd %q result: out=%s, err=%v"
,
oci
.
ShutDownCmd
,
out
,
err
)
}
else
{
out
,
err
:=
h
.
RunSSHCommand
(
"sudo poweroff"
)
// poweroff always results in an error, since the host disconnects.
glog
.
Infof
(
"poweroff result: out=%s, err=%v"
,
out
,
err
)
}
return
nil
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录