Skip to content

Commit 27e6515

Browse files
committed
only create cachedir if requested, since otherwise opm will error out serving it
Signed-off-by: grokspawn <[email protected]>
1 parent be9af88 commit 27e6515

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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
}

0 commit comments

Comments
 (0)