Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Chu Peng 楚鹏
minikube
提交
ac66bf2f
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 搜索 >>
未验证
提交
ac66bf2f
编写于
4月 19, 2020
作者:
M
Medya Gh
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
first working version
上级
c017c98e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
29 addition
and
12 deletion
+29
-12
pkg/drivers/kic/kic.go
pkg/drivers/kic/kic.go
+1
-1
pkg/minikube/cruntime/containerd.go
pkg/minikube/cruntime/containerd.go
+10
-6
pkg/minikube/download/preload.go
pkg/minikube/download/preload.go
+5
-0
pkg/minikube/machine/cache_images.go
pkg/minikube/machine/cache_images.go
+13
-5
未找到文件。
pkg/drivers/kic/kic.go
浏览文件 @
ac66bf2f
...
...
@@ -130,7 +130,7 @@ func (d *Driver) Create() error {
return
}
t
:=
time
.
Now
()
glog
.
Infof
(
"Starting extracting preloaded images to volume"
)
glog
.
Infof
(
"Starting extracting preloaded images to volume
....
"
)
// Extract preloaded images to container
if
err
:=
oci
.
ExtractTarballToVolume
(
download
.
TarballPath
(
d
.
NodeConfig
.
KubernetesVersion
,
d
.
NodeConfig
.
ContainerRuntime
),
params
.
Name
,
BaseImage
);
err
!=
nil
{
glog
.
Infof
(
"Unable to extract preloaded tarball to volume: %v"
,
err
)
...
...
pkg/minikube/cruntime/containerd.go
浏览文件 @
ac66bf2f
...
...
@@ -22,6 +22,7 @@ import (
"fmt"
"os/exec"
"path"
"runtime/debug"
"strings"
"text/template"
"time"
...
...
@@ -232,6 +233,7 @@ func (r *Containerd) ImageExists(name string, sha string) bool {
// LoadImage loads an image into this runtime
func
(
r
*
Containerd
)
LoadImage
(
path
string
)
error
{
debug
.
PrintStack
()
glog
.
Infof
(
"Loading image: %s"
,
path
)
c
:=
exec
.
Command
(
"sudo"
,
"ctr"
,
"-n=k8s.io"
,
"images"
,
"import"
,
path
)
if
_
,
err
:=
r
.
Runner
.
RunCmd
(
c
);
err
!=
nil
{
...
...
@@ -327,7 +329,7 @@ func (r *Containerd) Preload(cfg config.KubernetesConfig) error {
}
if
ContainerdImagesPreloaded
(
r
.
Runner
,
images
)
{
glog
.
Info
(
"Images already preloaded, skipping extraction"
)
return
nil
return
r
.
Restart
()
}
tarballPath
:=
download
.
TarballPath
(
k8sVersion
,
cRuntime
)
...
...
@@ -374,12 +376,14 @@ func (r *Containerd) Restart() error {
// ContainerdImagesPreloaded returns true if all images have been preloaded
func
ContainerdImagesPreloaded
(
runner
command
.
Runner
,
images
[]
string
)
bool
{
fmt
.
Printf
(
"medyadb inside ContainerdImagesPreloaded : images %s
\n
"
,
strings
.
Join
(
images
,
","
))
// rr, err := runner.RunCmd(exec.Command("sudo", "crictl", "images"))
// if err != nil {
// return false
// }
fmt
.
Println
(
"================================="
)
rr
,
err
:=
runner
.
RunCmd
(
exec
.
Command
(
"sudo"
,
"crictl"
,
"images"
))
if
err
!=
nil
{
return
false
}
// glog.Infof("Got contained preloaded images: %s", rr.Output())
glog
.
Infof
(
"Got contained preloaded images: %s"
,
rr
.
Output
())
fmt
.
Println
(
"================================="
)
// // Make sure images == imgs
// for _, i := range images {
...
...
pkg/minikube/download/preload.go
浏览文件 @
ac66bf2f
...
...
@@ -25,6 +25,7 @@ import (
"os"
"path/filepath"
"runtime"
"runtime/debug"
"cloud.google.com/go/storage"
"google.golang.org/api/option"
...
...
@@ -78,6 +79,10 @@ func remoteTarballURL(k8sVersion, containerRuntime string) string {
// PreloadExists returns true if there is a preloaded tarball that can be used
func
PreloadExists
(
k8sVersion
,
containerRuntime
string
)
bool
{
// TODO: debug why this func is being called two times
fmt
.
Println
(
"************************************************************************"
)
debug
.
PrintStack
()
fmt
.
Println
(
"************************************************************************"
)
glog
.
Infof
(
"Checking if preload exists for k8s version %s and runtime %s"
,
k8sVersion
,
containerRuntime
)
if
!
viper
.
GetBool
(
"preload"
)
{
return
false
...
...
pkg/minikube/machine/cache_images.go
浏览文件 @
ac66bf2f
...
...
@@ -64,12 +64,20 @@ func CacheImagesForBootstrapper(imageRepository string, version string, clusterB
// LoadImages loads previously cached images into the container runtime
func
LoadImages
(
cc
*
config
.
ClusterConfig
,
runner
command
.
Runner
,
images
[]
string
,
cacheDir
string
)
error
{
// Skip loading images if images already exist
if
cruntime
.
DockerImagesPreloaded
(
runner
,
images
)
{
glog
.
Infof
(
"Images are preloaded, skipping loading"
)
return
nil
if
cc
.
KubernetesConfig
.
ContainerRuntime
==
"docker"
{
// Skip loading images if images already exist
if
cruntime
.
DockerImagesPreloaded
(
runner
,
images
)
{
glog
.
Infof
(
"Images are preloaded, skipping loading"
)
return
nil
}
}
if
cc
.
KubernetesConfig
.
ContainerRuntime
==
"containerd"
{
// Skip loading images if images already exist
if
cruntime
.
ContainerdImagesPreloaded
(
runner
,
images
)
{
glog
.
Infof
(
"Images are preloaded, skipping loading"
)
return
nil
}
}
glog
.
Infof
(
"LoadImages start: %s"
,
images
)
start
:=
time
.
Now
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录