diff --git a/Documentation/install/install.md b/Documentation/install/install.md index e3b022defa5..5425ea3ffad 100644 --- a/Documentation/install/install.md +++ b/Documentation/install/install.md @@ -87,6 +87,10 @@ To configure a release of OLM for installation in a cluster: The above steps are automated for official releases with `make ver=0.3.0 release`, which will output new versions of manifests in `deploy/tectonic-alm-operator/manifests/$(ver)`. +## Overriding the Global Catalog Namespace + +It is possible to override the Global Catalog Namespace by setting the `CATALOG_NAMESPACE` environment variable in the catalog operator deployment. + ## Subscribe to a Package and Channel Cloud Services can be installed from the catalog by subscribing to a channel in the corresponding package. diff --git a/cmd/catalog/main.go b/cmd/catalog/main.go index 7bf09e5e783..7963df7105f 100644 --- a/cmd/catalog/main.go +++ b/cmd/catalog/main.go @@ -26,6 +26,7 @@ import ( ) const ( + catalogNamespaceEnvVarName = "CATALOG_NAMESPACE" defaultWakeupInterval = 15 * time.Minute defaultCatalogNamespace = "openshift-operator-lifecycle-manager" defaultConfigMapServerImage = "quay.io/operatorframework/configmap-operator-registry:latest" @@ -103,6 +104,12 @@ func main() { } logger.Infof("log level %s", logger.Level) + // If the catalogNamespaceEnvVarName environment variable is set update the value of catalogNamespace. + if catalogNamespaceEnvVarValue := os.Getenv(catalogNamespaceEnvVarName); catalogNamespaceEnvVarValue != "" { + logger.Infof("Global Catalog Namespace set to %s", catalogNamespaceEnvVarValue) + *catalogNamespace = catalogNamespaceEnvVarValue + } + var useTLS bool if *tlsCertPath != "" && *tlsKeyPath == "" || *tlsCertPath == "" && *tlsKeyPath != "" { logger.Warn("both --tls-key and --tls-crt must be provided for TLS to be enabled, falling back to non-https")