Skip to content

Commit 04b665c

Browse files
committed
Add a catalog-operator flag to set opmImage
Signed-off-by: Zvi Cahana <[email protected]>
1 parent fd34447 commit 04b665c

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

cmd/catalog/main.go

+6-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ const (
2828
catalogNamespaceEnvVarName = "GLOBAL_CATALOG_NAMESPACE"
2929
defaultWakeupInterval = 15 * time.Minute
3030
defaultCatalogNamespace = "openshift-operator-lifecycle-manager"
31-
defaultConfigMapServerImage = "quay.io/operatorframework/configmap-operator-registry:latest"
31+
defaultConfigMapServerImage = "quay.io/operator-framework/configmap-operator-registry:latest"
32+
defaultOPMImage = "quay.io/operator-framework/upstream-opm-builder:latest"
3233
defaultUtilImage = "quay.io/operator-framework/olm:latest"
3334
defaultOperatorName = ""
3435
)
@@ -47,6 +48,9 @@ var (
4748
configmapServerImage = flag.String(
4849
"configmapServerImage", defaultConfigMapServerImage, "the image to use for serving the operator registry api for a configmap")
4950

51+
opmImage = flag.String(
52+
"opmImage", defaultOPMImage, "the image to use for unpacking bundle content with opm")
53+
5054
utilImage = flag.String(
5155
"util-image", defaultUtilImage, "an image containing custom olm utilities")
5256

@@ -131,7 +135,7 @@ func main() {
131135
}
132136

133137
// Create a new instance of the operator.
134-
op, err := catalog.NewOperator(ctx, *kubeConfigPath, utilclock.RealClock{}, logger, *wakeupInterval, *configmapServerImage, *utilImage, *catalogNamespace, k8sscheme.Scheme, *installPlanTimeout, *bundleUnpackTimeout)
138+
op, err := catalog.NewOperator(ctx, *kubeConfigPath, utilclock.RealClock{}, logger, *wakeupInterval, *configmapServerImage, *opmImage, *utilImage, *catalogNamespace, k8sscheme.Scheme, *installPlanTimeout, *bundleUnpackTimeout)
135139
if err != nil {
136140
log.Panicf("error configuring operator: %s", err.Error())
137141
}

pkg/controller/operators/catalog/operator.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ type Operator struct {
115115
type CatalogSourceSyncFunc func(logger *logrus.Entry, in *v1alpha1.CatalogSource) (out *v1alpha1.CatalogSource, continueSync bool, syncError error)
116116

117117
// NewOperator creates a new Catalog Operator.
118-
func NewOperator(ctx context.Context, kubeconfigPath string, clock utilclock.Clock, logger *logrus.Logger, resync time.Duration, configmapRegistryImage, utilImage string, operatorNamespace string, scheme *runtime.Scheme, installPlanTimeout time.Duration, bundleUnpackTimeout time.Duration) (*Operator, error) {
118+
func NewOperator(ctx context.Context, kubeconfigPath string, clock utilclock.Clock, logger *logrus.Logger, resync time.Duration, configmapRegistryImage, opmImage, utilImage string, operatorNamespace string, scheme *runtime.Scheme, installPlanTimeout time.Duration, bundleUnpackTimeout time.Duration) (*Operator, error) {
119119
resyncPeriod := queueinformer.ResyncWithJitter(resync, 0.2)
120120
config, err := clientcmd.BuildConfigFromFlags("", kubeconfigPath)
121121
if err != nil {
@@ -351,7 +351,7 @@ func NewOperator(ctx context.Context, kubeconfigPath string, clock utilclock.Clo
351351
bundle.WithPodLister(podInformer.Lister()),
352352
bundle.WithRoleLister(roleInformer.Lister()),
353353
bundle.WithRoleBindingLister(roleBindingInformer.Lister()),
354-
bundle.WithOPMImage(configmapRegistryImage),
354+
bundle.WithOPMImage(opmImage),
355355
bundle.WithUtilImage(utilImage),
356356
bundle.WithNow(op.now),
357357
bundle.WithUnpackTimeout(op.bundleUnpackTimeout),

0 commit comments

Comments
 (0)