Skip to content

Commit

Permalink
Merge pull request #1014 from awgreene/configure-global-catalog-ns
Browse files Browse the repository at this point in the history
[CatalogSource] Set Global Catalog NS with EnvVar
  • Loading branch information
openshift-merge-robot authored Aug 29, 2019
2 parents 02c3e06 + c0b2c3c commit 5693e6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Documentation/install/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 `GLOBAL_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.
Expand Down
7 changes: 7 additions & 0 deletions cmd/catalog/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import (
)

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

// If the catalogNamespaceEnvVarName environment variable is set, then update the value of catalogNamespace.
if catalogNamespaceEnvVarValue := os.Getenv(catalogNamespaceEnvVarName); catalogNamespaceEnvVarValue != "" {
logger.Infof("%s environment variable is set. Updating Global Catalog Namespace to %s", catalogNamespaceEnvVarName, 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")
Expand Down

0 comments on commit 5693e6d

Please sign in to comment.