Skip to content

Commit 917ba60

Browse files
Merge pull request #1013 from openshift-bot/synchronize-upstream
NO-ISSUE: Synchronize From Upstream Repositories
2 parents ebcdb8f + 852c85f commit 917ba60

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

staging/operator-lifecycle-manager/pkg/controller/registry/reconciler/reconciler.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -305,12 +305,14 @@ func Pod(source *operatorsv1alpha1.CatalogSource, name, opmImg, utilImage, img s
305305

306306
pod.Spec.Containers[0].Image = opmImg
307307
pod.Spec.Containers[0].Command = []string{"/bin/opm"}
308-
// set service cache dir unconditionally, since it should always have compatible permissions for generation, if not provided by grpcPodConfig
309-
pod.Spec.Containers[0].Args = []string{
308+
var containerArgs = []string{
310309
"serve",
311310
filepath.Join(catalogPath, "catalog"),
312-
"--cache-dir=" + filepath.Join(catalogPath, "cache"),
313311
}
312+
if grpcPodConfig.ExtractContent.CacheDir != "" {
313+
containerArgs = append(containerArgs, "--cache-dir="+filepath.Join(catalogPath, "cache"))
314+
}
315+
pod.Spec.Containers[0].Args = containerArgs
314316
pod.Spec.Containers[0].VolumeMounts = append(pod.Spec.Containers[0].VolumeMounts, contentVolumeMount)
315317
}
316318
}

staging/operator-lifecycle-manager/pkg/controller/registry/reconciler/reconciler_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ func TestPodExtractContent(t *testing.T) {
400400
ObjectMeta: metav1.ObjectMeta{
401401
GenerateName: "test-",
402402
Namespace: "testns",
403-
Labels: map[string]string{"olm.pod-spec-hash": "b0yrMl85J8bFjFWNl1O2XxsX698iPAjbpNhRIT", "olm.managed": "true"},
403+
Labels: map[string]string{"olm.pod-spec-hash": "b4ns9MTvaRBYOarmuFe6PLYK0r2kxj5Vo06WTU", "olm.managed": "true"},
404404
Annotations: map[string]string{"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"},
405405
},
406406
Spec: corev1.PodSpec{
@@ -444,7 +444,7 @@ func TestPodExtractContent(t *testing.T) {
444444
Name: "name",
445445
Image: "opmImage",
446446
Command: []string{"/bin/opm"},
447-
Args: []string{"serve", "/extracted-catalog/catalog", "--cache-dir=/extracted-catalog/cache"},
447+
Args: []string{"serve", "/extracted-catalog/catalog"},
448448
Ports: []corev1.ContainerPort{{Name: "grpc", ContainerPort: 50051}},
449449
ReadinessProbe: &corev1.Probe{
450450
ProbeHandler: corev1.ProbeHandler{
@@ -719,7 +719,7 @@ func TestPodExtractContent(t *testing.T) {
719719
ObjectMeta: metav1.ObjectMeta{
720720
GenerateName: "test-",
721721
Namespace: "testns",
722-
Labels: map[string]string{"olm.pod-spec-hash": "3qxzUcTKDfq8QwZPoXteAv35FSwRho7vyYkv4d", "olm.managed": "true"},
722+
Labels: map[string]string{"olm.pod-spec-hash": "cO4moUo3vz6jZlcoBcxY4BB8o8a4E7m5GXCzI", "olm.managed": "true"},
723723
Annotations: map[string]string{"cluster-autoscaler.kubernetes.io/safe-to-evict": "true"},
724724
},
725725
Spec: corev1.PodSpec{
@@ -771,7 +771,7 @@ func TestPodExtractContent(t *testing.T) {
771771
Name: "name",
772772
Image: "opmImage",
773773
Command: []string{"/bin/opm"},
774-
Args: []string{"serve", "/extracted-catalog/catalog", "--cache-dir=/extracted-catalog/cache"},
774+
Args: []string{"serve", "/extracted-catalog/catalog"},
775775
Ports: []corev1.ContainerPort{{Name: "grpc", ContainerPort: 50051}},
776776
ReadinessProbe: &corev1.Probe{
777777
ProbeHandler: corev1.ProbeHandler{

vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/registry/reconciler/reconciler.go

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)