add comment to clarify change in checking logic

pull/17671/head
Predrag Rogic 2023-11-28 01:28:14 +00:00
parent a5d281e284
commit 199a0e3eae
No known key found for this signature in database
GPG Key ID: F1FF5748C4855229
1 changed files with 1 additions and 0 deletions

View File

@ -250,6 +250,7 @@ func (r *Containerd) Disable() error {
func (r *Containerd) ImageExists(name string, sha string) bool {
klog.Infof("Checking existence of image with name %q and sha %q", name, sha)
c := exec.Command("sudo", "ctr", "-n=k8s.io", "images", "check")
// note: image name and image id's sha can be on different lines in ctr output
if rr, err := r.Runner.RunCmd(c); err != nil ||
!strings.Contains(rr.Output(), name) ||
(sha != "" && !strings.Contains(rr.Output(), sha)) {