Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/olm/operator/registry/configmap/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
})
})

Expand Down
2 changes: 1 addition & 1 deletion internal/olm/operator/registry/index/registry_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/olm/operator/registry/index/registry_pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}