Unverified Commit e48cccea authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #66823 from bart0sh/PR0026-kubeadm-fix-ImagePullCheck-output

Automatic merge from submit-queue (batch tested with PRs 64815, 66823, 66473, 66466). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. kubeadm: fix ImagePullCheck output **What this PR does / why we need it**: ImagePullCheck outputs "pulling <image>" line even if image already exists and is not pulled. Fixed the output to reflect the reality. ImagePullCheck now outputs either "pulling <image>" or "image <image> exists". **Release note**: ```release-note NONE ```
parents cb1ef9f7 84300e78
...@@ -829,14 +829,15 @@ func (ImagePullCheck) Name() string { ...@@ -829,14 +829,15 @@ func (ImagePullCheck) Name() string {
// Check pulls images required by kubeadm. This is a mutating check // Check pulls images required by kubeadm. This is a mutating check
func (ipc ImagePullCheck) Check() (warnings, errors []error) { func (ipc ImagePullCheck) Check() (warnings, errors []error) {
for _, image := range ipc.imageList { for _, image := range ipc.imageList {
glog.V(1).Infoln("pulling ", image)
ret, err := ipc.runtime.ImageExists(image) ret, err := ipc.runtime.ImageExists(image)
if ret && err == nil { if ret && err == nil {
glog.V(1).Infof("image exists: %s", image)
continue continue
} }
if err != nil { if err != nil {
errors = append(errors, fmt.Errorf("failed to check if image %s exists: %v", image, err)) errors = append(errors, fmt.Errorf("failed to check if image %s exists: %v", image, err))
} }
glog.V(1).Infof("pulling %s", image)
if err := ipc.runtime.PullImage(image); err != nil { if err := ipc.runtime.PullImage(image); err != nil {
errors = append(errors, fmt.Errorf("failed to pull image %s: %v", image, err)) errors = append(errors, fmt.Errorf("failed to pull image %s: %v", image, err))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment