Skip to content

Commit 5693e6d

Browse files
Merge pull request #1014 from awgreene/configure-global-catalog-ns
[CatalogSource] Set Global Catalog NS with EnvVar
2 parents 02c3e06 + c0b2c3c commit 5693e6d

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Documentation/install/install.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ To configure a release of OLM for installation in a cluster:
8787

8888
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)`.
8989

90+
## Overriding the Global Catalog Namespace
91+
92+
It is possible to override the Global Catalog Namespace by setting the `GLOBAL_CATALOG_NAMESPACE` environment variable in the catalog operator deployment.
93+
9094
## Subscribe to a Package and Channel
9195

9296
Cloud Services can be installed from the catalog by subscribing to a channel in the corresponding package.

cmd/catalog/main.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import (
2626
)
2727

2828
const (
29+
catalogNamespaceEnvVarName = "GLOBAL_CATALOG_NAMESPACE"
2930
defaultWakeupInterval = 15 * time.Minute
3031
defaultCatalogNamespace = "openshift-operator-lifecycle-manager"
3132
defaultConfigMapServerImage = "quay.io/operatorframework/configmap-operator-registry:latest"
@@ -103,6 +104,12 @@ func main() {
103104
}
104105
logger.Infof("log level %s", logger.Level)
105106

107+
// If the catalogNamespaceEnvVarName environment variable is set, then update the value of catalogNamespace.
108+
if catalogNamespaceEnvVarValue := os.Getenv(catalogNamespaceEnvVarName); catalogNamespaceEnvVarValue != "" {
109+
logger.Infof("%s environment variable is set. Updating Global Catalog Namespace to %s", catalogNamespaceEnvVarName, catalogNamespaceEnvVarValue)
110+
*catalogNamespace = catalogNamespaceEnvVarValue
111+
}
112+
106113
var useTLS bool
107114
if *tlsCertPath != "" && *tlsKeyPath == "" || *tlsCertPath == "" && *tlsKeyPath != "" {
108115
logger.Warn("both --tls-key and --tls-crt must be provided for TLS to be enabled, falling back to non-https")

0 commit comments

Comments
 (0)