diff --git a/internal/olm/operator/registry/configmap/deployment.go b/internal/olm/operator/registry/configmap/deployment.go index 566fdc6da99..75d4f705f53 100644 --- a/internal/olm/operator/registry/configmap/deployment.go +++ b/internal/olm/operator/registry/configmap/deployment.go @@ -106,7 +106,7 @@ func withContainerVolumeMounts(volName string, paths ...string) func(*appsv1.Dep func getDBContainerCmd(dbPath, logPath string) string { initCmd := fmt.Sprintf("/bin/initializer -o %s -m %s", dbPath, containerManifestsDir) srvCmd := fmt.Sprintf("/bin/registry-server -d %s -t %s", dbPath, logPath) - return fmt.Sprintf("%s && %s", initCmd, srvCmd) + return fmt.Sprintf("%s && exec %s", initCmd, srvCmd) } // withRegistryGRPCContainer returns a function that appends a container diff --git a/internal/olm/operator/registry/configmap/deployment_test.go b/internal/olm/operator/registry/configmap/deployment_test.go index 31dade87135..e9a56938133 100644 --- a/internal/olm/operator/registry/configmap/deployment_test.go +++ b/internal/olm/operator/registry/configmap/deployment_test.go @@ -160,7 +160,7 @@ var _ = Describe("Deployment", func() { initCmd := "/bin/initializer -o /path/to/database.db -m /registry/manifests" srvCmd := "/bin/registry-server -d /path/to/database.db -t /var/log/temp.log" - Expect(getDBContainerCmd("/path/to/database.db", "/var/log/temp.log")).Should(Equal(fmt.Sprintf("%s && %s", initCmd, srvCmd))) + Expect(getDBContainerCmd("/path/to/database.db", "/var/log/temp.log")).Should(Equal(fmt.Sprintf("%s && exec %s", initCmd, srvCmd))) }) }) diff --git a/internal/olm/operator/registry/index/registry_pod.go b/internal/olm/operator/registry/index/registry_pod.go index ccbf9bf3166..7f1849b6242 100644 --- a/internal/olm/operator/registry/index/registry_pod.go +++ b/internal/olm/operator/registry/index/registry_pod.go @@ -377,7 +377,7 @@ const cmdTemplate = `[[ -f {{ .DBPath }} ]] && cp {{ .DBPath }} /tmp/tmp.db; \ {{- range $i, $item := .BundleItems }} opm registry add -d /tmp/tmp.db -b {{ $item.ImageTag }} --mode={{ $item.AddMode }}{{ if $.CASecretName }} --ca-file=/certs/cert.pem{{ end }} --skip-tls-verify={{ $.SkipTLSVerify }} --use-http={{ $.UseHTTP }} && \ {{- end }} -opm registry serve -d /tmp/tmp.db -p {{ .GRPCPort }} +exec opm registry serve -d /tmp/tmp.db -p {{ .GRPCPort }} ` // getContainerCmd uses templating to construct the container command diff --git a/internal/olm/operator/registry/index/registry_pod_test.go b/internal/olm/operator/registry/index/registry_pod_test.go index 40cd21baf40..f7a9a997765 100644 --- a/internal/olm/operator/registry/index/registry_pod_test.go +++ b/internal/olm/operator/registry/index/registry_pod_test.go @@ -291,5 +291,5 @@ func containerCommandFor(dbPath string, items []BundleItem, hasCA, skipTLSVerify additions.WriteString(fmt.Sprintf("opm registry add -d /tmp/tmp.db -b %s --mode=%s%s --skip-tls-verify=%v --use-http=%v && \\\n", item.ImageTag, item.AddMode, caFlag, skipTLSVerify, useHTTP)) } - return fmt.Sprintf("[[ -f %s ]] && cp %s /tmp/tmp.db; \\\n%sopm registry serve -d /tmp/tmp.db -p 50051\n", dbPath, dbPath, additions.String()) + return fmt.Sprintf("[[ -f %s ]] && cp %s /tmp/tmp.db; \\\n%sexec opm registry serve -d /tmp/tmp.db -p 50051\n", dbPath, dbPath, additions.String()) }