Skip to content

Commit f8d6f61

Browse files
registry/reconciler: use appropriate image pull policy for catalog
Signed-off-by: Steve Kuznetsov <[email protected]>
1 parent dc0c564 commit f8d6f61

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

Diff for: pkg/controller/registry/reconciler/reconciler.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -285,9 +285,10 @@ func Pod(source *operatorsv1alpha1.CatalogSource, name, opmImg, utilImage, img s
285285
Args: []string{"/bin/copy-content", fmt.Sprintf("%s/copy-content", utilitiesPath)},
286286
VolumeMounts: []corev1.VolumeMount{utilitiesVolumeMount},
287287
}, corev1.Container{
288-
Name: "extract-content",
289-
Image: img,
290-
Command: []string{utilitiesPath + "/copy-content"},
288+
Name: "extract-content",
289+
Image: img,
290+
ImagePullPolicy: image.InferImagePullPolicy(img),
291+
Command: []string{utilitiesPath + "/copy-content"},
291292
Args: []string{
292293
"--catalog.from=" + grpcPodConfig.ExtractContent.CatalogDir,
293294
"--catalog.to=" + fmt.Sprintf("%s/catalog", catalogPath),

Diff for: pkg/controller/registry/reconciler/reconciler_test.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ func TestPodExtractContent(t *testing.T) {
277277
ObjectMeta: metav1.ObjectMeta{
278278
GenerateName: "test-",
279279
Namespace: "testns",
280-
Labels: map[string]string{"olm.pod-spec-hash": "6AsUxiAHW383luxWxmVVATFBeHXKNIX0HXrP5g", "olm.managed": "true"},
280+
Labels: map[string]string{"olm.pod-spec-hash": "2AHzz8IDqQLwPsDyu4UjUmnROr4E59PMKm9OCm", "olm.managed": "true"},
281281
Annotations: map[string]string{"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"},
282282
},
283283
Spec: corev1.PodSpec{
@@ -300,9 +300,10 @@ func TestPodExtractContent(t *testing.T) {
300300
VolumeMounts: []corev1.VolumeMount{{Name: "utilities", MountPath: "/utilities"}},
301301
},
302302
{
303-
Name: "extract-content",
304-
Image: "image",
305-
Command: []string{"/utilities/copy-content"},
303+
Name: "extract-content",
304+
Image: "image",
305+
ImagePullPolicy: image.InferImagePullPolicy("image"),
306+
Command: []string{"/utilities/copy-content"},
306307
Args: []string{
307308
"--catalog.from=/catalog",
308309
"--catalog.to=/extracted-catalog/catalog",

0 commit comments

Comments
 (0)