Skip to content

Commit

Permalink
make catalog ref configurable via CATALOG_IMG env var
Browse files Browse the repository at this point in the history
Signed-off-by: Bryce Palmer <everettraven@gmail.com>
  • Loading branch information
everettraven committed Nov 1, 2023
1 parent dcce1ff commit 370eecd
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/operator-framework-e2e/operator_framework_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package operatore2e

import (
"context"
"os"
"testing"
"time"

Expand Down Expand Up @@ -51,6 +52,16 @@ var _ = BeforeSuite(func() {
ctx = context.Background()
})

// Since the CATALOG_IMG environment variable is used to configure the
// tag of the catalog image that is built see if it is specified and use
// it if it is. Otherwise use the default that is used in setup.sh
func getCatalogRef() string {
if val, exist := os.LookupEnv("CATALOG_IMG"); exist {
return val
}
return "oc-opdev-e2e.operatorframework.io/catalog:e2e"
}

var _ = Describe("Operator Framework E2E", func() {
var catalog *catalogd.Catalog
BeforeEach(func() {
Expand All @@ -62,8 +73,7 @@ var _ = Describe("Operator Framework E2E", func() {
Source: catalogd.CatalogSource{
Type: catalogd.SourceTypeImage,
Image: &catalogd.ImageSource{
// TODO: make this configurable
Ref: "localhost/catalog:e2e",
Ref: getCatalogRef(),
},
},
},
Expand Down

0 comments on commit 370eecd

Please sign in to comment.