func pullIfNotPresent(logger log.Logger, image string, retries int) (pulled bool, err error) {
	cmd := exec.Command("podman", "inspect", "--type=image", image)
	if err := cmd.Run(); err == nil {
		logger.V(1).Infof("Image: %s present locally", image)
		return false, nil
	}
	return true, pull(logger, image, retries)
}
pullIfNotPresent will pull an image if it is not present locally
retrying up to retries times
it returns true if it attempted to pull, and any errors from pulling
package podman
import (
	"fmt"
	"strings"
	"time"
	"sigs.k8s.io/kind/pkg/errors"
	"sigs.k8s.io/kind/pkg/exec"
	"sigs.k8s.io/kind/pkg/log"
	"sigs.k8s.io/kind/pkg/cluster/internal/providers/common"
	"sigs.k8s.io/kind/pkg/internal/apis/config"
	"sigs.k8s.io/kind/pkg/internal/cli"
)
func ensureNodeImages(logger log.Logger, status *cli.Status, cfg *config.Cluster) error {
	for _, image := range common.RequiredNodeImages(cfg).List() {
		friendlyImageName, image := sanitizeImage(image)
		status.Start(fmt.Sprintf("Ensuring node image (%s) 🖼", friendlyImageName))
		if _, err := pullIfNotPresent(logger, image, 4); err != nil {
			status.End(false)
			return err
		}
	}
	return nil
}