Merge pull request #27707 from yifan-gu/stage1_name

Automatic merge from submit-queue

rkt: Map kubelet's `--stage1-image` flag to rkt's `--stage1-name` flag.

This enables rkt to use cached stage1 image instead of unpacking the stage1 image every time for every pod.

After this change, users need to preload the stage1 images in order to enable rkt to find the stage1 image with the name specified by this flag.

Also, the cloud config is modified to pre-load the stage1 images.

cc @kubernetes/sig-rktnetes @kubernetes/sig-node
This commit is contained in:
k8s-merge-robot
2016-06-20 16:40:09 -07:00
committed by GitHub
9 changed files with 45 additions and 19 deletions

View File

@@ -1028,7 +1028,7 @@ func (r *Runtime) preparePodArgs(manifest *appcschema.PodManifest, manifestFileN
// 3) empty; whatever rkt's compiled to default to
stage1ImageCmd := ""
if r.config.Stage1Image != "" {
stage1ImageCmd = "--stage1-path=" + r.config.Stage1Image
stage1ImageCmd = "--stage1-name=" + r.config.Stage1Image
}
if stage1Name, ok := manifest.Annotations.Get(k8sRktStage1NameAnno); ok {
stage1ImageCmd = "--stage1-name=" + stage1Name

View File

@@ -1832,15 +1832,15 @@ func TestPreparePodArgs(t *testing.T) {
},
},
},
"stage1-path",
"stage1-image0",
[]string{"prepare", "--quiet", "--pod-manifest", "file", "--stage1-name=stage1-image"},
},
{
appcschema.PodManifest{
Annotations: appctypes.Annotations{},
},
"stage1-path",
[]string{"prepare", "--quiet", "--pod-manifest", "file", "--stage1-path=stage1-path"},
"stage1-image0",
[]string{"prepare", "--quiet", "--pod-manifest", "file", "--stage1-name=stage1-image0"},
},
{
appcschema.PodManifest{