Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
73772286
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,体验更适合开发者的 AI 搜索 >>
提交
73772286
编写于
2月 24, 2021
作者:
M
Medya Gh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
address review comments
上级
7f3b2c2a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
6 addition
and
16 deletion
+6
-16
Makefile
Makefile
+0
-4
cmd/auto-pause/auto-pause.go
cmd/auto-pause/auto-pause.go
+5
-11
deploy/addons/auto-pause/auto-pause.service
deploy/addons/auto-pause/auto-pause.service
+1
-1
未找到文件。
Makefile
浏览文件 @
73772286
...
...
@@ -812,10 +812,6 @@ site: site/themes/docsy/assets/vendor/bootstrap/package.js out/hugo/hugo ## Serv
out/mkcmp
:
GOOS
=
$(GOOS)
GOARCH
=
$(GOARCH)
go build
-o
$@
cmd/performance/mkcmp/main.go
.PHONY
:
out/auto-pause
#
auto pause binary to be used for auto-pause addon (only linux)
out/auto-pause
:
$(SOURCE_GENERATED) $(SOURCE_FILES)
GOOS
=
linux
GOARCH
=
$(GOARCH)
go build
-o
$@
cmd/auto-pause/auto-pause.go
.PHONY
:
deploy/kicbase/auto-pause
#
auto pause binary to be used for kic image work arround for not passing the whole repo as docker context
deploy/kicbase/auto-pause
:
$(SOURCE_GENERATED) $(SOURCE_FILES)
GOOS
=
linux
GOARCH
=
$(GOARCH)
go build
-o
$@
cmd/auto-pause/auto-pause.go
...
...
cmd/auto-pause/auto-pause.go
浏览文件 @
73772286
...
...
@@ -32,7 +32,7 @@ import (
"k8s.io/minikube/pkg/minikube/style"
)
var
incomeCh
=
make
(
chan
struct
{})
var
unpauseRequests
=
make
(
chan
struct
{})
var
done
=
make
(
chan
struct
{})
var
mu
sync
.
Mutex
...
...
@@ -53,7 +53,7 @@ func main() {
select
{
case
<-
time
.
After
(
interval
)
:
runPause
()
case
<-
incomeCh
:
case
<-
unpauseRequests
:
fmt
.
Printf
(
"Got request
\n
"
)
if
runtimePaused
{
runUnpause
()
...
...
@@ -71,7 +71,7 @@ func main() {
// handler echoes the Path component of the requested URL.
func
handler
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
incomeCh
<-
struct
{}{}
unpauseRequests
<-
struct
{}{}
<-
done
fmt
.
Fprintf
(
w
,
"allow"
)
}
...
...
@@ -83,8 +83,6 @@ func runPause() {
return
}
ids
:=
[]
string
{}
r
:=
command
.
NewExecRunner
(
true
)
cr
,
err
:=
cruntime
.
New
(
cruntime
.
Config
{
Type
:
runtime
,
Runner
:
r
})
...
...
@@ -98,9 +96,8 @@ func runPause() {
}
runtimePaused
=
true
ids
=
append
(
ids
,
uids
...
)
out
.
Step
(
style
.
Unpause
,
"Paused {{.count}} containers"
,
out
.
V
{
"count"
:
len
(
ids
)})
out
.
Step
(
style
.
Unpause
,
"Paused {{.count}} containers"
,
out
.
V
{
"count"
:
len
(
u
ids
)})
}
func
runUnpause
()
{
...
...
@@ -108,8 +105,6 @@ func runUnpause() {
mu
.
Lock
()
defer
mu
.
Unlock
()
ids
:=
[]
string
{}
r
:=
command
.
NewExecRunner
(
true
)
cr
,
err
:=
cruntime
.
New
(
cruntime
.
Config
{
Type
:
runtime
,
Runner
:
r
})
...
...
@@ -121,8 +116,7 @@ func runUnpause() {
if
err
!=
nil
{
exit
.
Error
(
reason
.
GuestUnpause
,
"Unpause"
,
err
)
}
ids
=
append
(
ids
,
uids
...
)
runtimePaused
=
false
out
.
Step
(
style
.
Unpause
,
"Unpaused {{.count}} containers"
,
out
.
V
{
"count"
:
len
(
ids
)})
out
.
Step
(
style
.
Unpause
,
"Unpaused {{.count}} containers"
,
out
.
V
{
"count"
:
len
(
u
ids
)})
}
deploy/addons/auto-pause/auto-pause.service
浏览文件 @
73772286
...
...
@@ -7,4 +7,4 @@ ExecStart=/usr/local/bin/auto-pause
Restart
=
always
[Install]
WantedBy
=
multi-user.target
\ No newline at end of file
WantedBy
=
multi-user.target
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录