github.com/operator-framework/operator-lifecycle-manager@v0.30.0/pkg/lib/image/image.go (about)

     1  package image
     2  
     3  import (
     4  	"strings"
     5  
     6  	corev1 "k8s.io/api/core/v1"
     7  )
     8  
     9  func InferImagePullPolicy(image string) corev1.PullPolicy {
    10  	// Ensure the image is always pulled if the image is not based on a digest, measured by whether an "@" is included.
    11  	// See https://github.com/docker/distribution/blob/master/reference/reference.go for more info.
    12  	// This means recreating non-digest based pods will result in the latest version of the content being delivered on-cluster.
    13  	if strings.Contains(image, "@") {
    14  		return corev1.PullIfNotPresent
    15  	}
    16  	return corev1.PullAlways
    17  }