Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
47396dc7
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,发现更多精彩内容 >>
未验证
提交
47396dc7
编写于
11月 10, 2020
作者:
T
Thomas Strömberg
提交者:
GitHub
11月 10, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #9532 from prezha/hack-update--kicbase-version
hack/update: kicbase version
上级
f3f404ce
e38d49a2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
15 addition
and
14 deletion
+15
-14
hack/update/kicbase_version/update_kicbase_version.go
hack/update/kicbase_version/update_kicbase_version.go
+15
-14
未找到文件。
hack/update/kicbase_version/update_kicbase_version.go
浏览文件 @
47396dc7
...
...
@@ -55,6 +55,7 @@ import (
"time"
"k8s.io/klog/v2"
"k8s.io/minikube/hack/update"
)
...
...
@@ -75,13 +76,13 @@ var (
},
}
//
pull request
data
//
PR
data
prBranchPrefix
=
"update-kicbase-version_"
// will be appended with first 7 characters of the PR commit SHA
prTitle
=
`update-kicbase-version: {"{{.StableVersion}}"}`
prTitle
=
`update-kicbase-version: {
stable:
"{{.StableVersion}}"}`
prIssue
=
9420
)
// Data holds current and stable KIC
B
ase image versions
// Data holds current and stable KIC
b
ase image versions
type
Data
struct
{
CurrentVersion
string
`json:"CurrentVersion"`
StableVersion
string
`json:"StableVersion"`
...
...
@@ -92,33 +93,33 @@ func main() {
ctx
,
cancel
:=
context
.
WithTimeout
(
context
.
Background
(),
cxTimeout
)
defer
cancel
()
// determine current and stable
kic
base image versions
// determine current and stable
KIC
base image versions
current
,
stable
,
err
:=
KICVersions
()
if
err
!=
nil
{
klog
.
Fatalf
(
"
failed getting kic
base image versions: %v"
,
err
)
klog
.
Fatalf
(
"
Unable to get KIC
base image versions: %v"
,
err
)
}
if
len
(
current
)
==
0
||
len
(
stable
)
==
0
{
klog
.
Fatalf
(
"
cannot determine kic
base image versions"
)
klog
.
Fatalf
(
"
Unable to determine KIC
base image versions"
)
}
data
:=
Data
{
CurrentVersion
:
current
,
StableVersion
:
stable
}
klog
.
Infof
(
"
kic
base image versions: 'current' is %s and 'stable' would be %s"
,
data
.
CurrentVersion
,
data
.
StableVersion
)
klog
.
Infof
(
"
KIC
base image versions: 'current' is %s and 'stable' would be %s"
,
data
.
CurrentVersion
,
data
.
StableVersion
)
// prepare local
kic
base image
// prepare local
KIC
base image
image
,
err
:=
prepareImage
(
ctx
,
data
)
if
err
!=
nil
{
klog
.
Fatalf
(
"
failed preparing local kic
base reference image: %v"
,
err
)
klog
.
Fatalf
(
"
Unable to prepare local KIC
base reference image: %v"
,
err
)
}
klog
.
Infof
(
"
local kic
base reference image: %s"
,
image
)
klog
.
Infof
(
"
Local KIC
base reference image: %s"
,
image
)
// update registries
if
updated
:=
update
.
CRUpdateAll
(
ctx
,
image
,
data
.
StableVersion
);
!
updated
{
klog
.
Fatalf
(
"
failed updating all registries
"
)
klog
.
Fatalf
(
"
Unable to update any registry
"
)
}
update
.
Apply
(
ctx
,
schema
,
data
,
prBranchPrefix
,
prTitle
,
prIssue
)
}
// KICVersions returns current and stable
kic base image versions and any error
// KICVersions returns current and stable
KIC base image versions and any error occurred.
func
KICVersions
()
(
current
,
stable
string
,
err
error
)
{
blob
,
err
:=
ioutil
.
ReadFile
(
filepath
.
Join
(
update
.
FSRoot
,
kicFile
))
if
err
!=
nil
{
...
...
@@ -134,8 +135,8 @@ func KICVersions() (current, stable string, err error) {
return
current
,
stable
,
nil
}
// prepareImage checks if current image exists locally, tries to pull it if not,
//
tags it with release version, returns reference image url and any error
// prepareImage checks if current image exists locally, tries to pull it if not,
tags it with release version.
//
Returns reference image url and any error occurred.
func
prepareImage
(
ctx
context
.
Context
,
data
Data
)
(
image
string
,
err
error
)
{
image
,
err
=
update
.
PullImage
(
ctx
,
data
.
CurrentVersion
,
data
.
StableVersion
)
if
err
!=
nil
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录