Skip to content

Commit b202a7a

Browse files
authored
Merge pull request #142 from tchughesiv/ocpVersions0.1.4
cherry-pick: deploy different console plugin images based on ocp version
2 parents 2f4dd58 + 3db52f0 commit b202a7a

File tree

5 files changed

+326
-43
lines changed

5 files changed

+326
-43
lines changed

controllers/dbaasplatform_controller.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import (
2929
"github.com/RHEcosystemAppEng/dbaas-operator/controllers/reconcilers/console_plugin"
3030
providers_installation "github.com/RHEcosystemAppEng/dbaas-operator/controllers/reconcilers/providers_installation"
3131
"github.com/RHEcosystemAppEng/dbaas-operator/controllers/reconcilers/quickstart_installation"
32+
"golang.org/x/mod/semver"
3233

3334
"github.com/go-logr/logr"
3435

@@ -72,6 +73,7 @@ type DBaaSPlatformReconciler struct {
7273
Log logr.Logger
7374
installComplete bool
7475
operatorNameVersion string
76+
OcpVersion string
7577
}
7678

7779
//+kubebuilder:rbac:groups=dbaas.redhat.com,resources=*,verbs=get;list;watch;create;update;patch;delete
@@ -239,6 +241,9 @@ func (r *DBaaSPlatformReconciler) getReconcilerForPlatform(platformConfig dbaasv
239241
case dbaasv1alpha1.TypeProvider:
240242
return providers_installation.NewReconciler(r.Client, r.Scheme, r.Log, platformConfig)
241243
case dbaasv1alpha1.TypeConsolePlugin:
244+
if r.OcpVersion != "" && semver.Compare(r.OcpVersion, "v4.9") <= 0 {
245+
platformConfig.Image += reconcilers.CONSOLE_PLUGIN_49_TAG
246+
}
242247
return console_plugin.NewReconciler(r.Client, r.Scheme, r.Log, platformConfig)
243248
case dbaasv1alpha1.TypeQuickStart:
244249
return quickstart_installation.NewReconciler(r.Client, r.Scheme, r.Log)

controllers/reconcilers/constants.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const (
1010
INSTALL_NAMESPACE = "openshift-operators"
1111
CATALOG_NAMESPACE = "openshift-marketplace"
1212
DBAAS_OPERATOR_VERSION_KEY_ENV = "DBAAS_OPERATOR_VERSION"
13+
CONSOLE_PLUGIN_49_TAG = "-4.9"
1314

1415
// CRUNCHY_BRIDGE
1516
CRUNCHY_BRIDGE_CATALOG_IMG = "registry.developers.crunchydata.com/crunchydata/crunchy-bridge-operator-catalog:v0.0.2"

go.mod

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,18 @@ module github.com/RHEcosystemAppEng/dbaas-operator
33
go 1.16
44

55
require (
6+
github.com/RHsyseng/operator-utils v1.4.9
67
github.com/go-logr/logr v0.4.0
78
github.com/onsi/ginkgo v1.16.4
8-
github.com/onsi/gomega v1.13.0
9+
github.com/onsi/gomega v1.15.0
910
github.com/openshift/api v0.0.0-20210910062324-a41d3573a3ba
10-
github.com/openshift/client-go v0.0.0-20200320143156-e7fa42a1261e
11+
github.com/openshift/client-go v0.0.0-20210521082421-73d9475a9142
1112
github.com/operator-framework/api v0.10.5
12-
go.uber.org/zap v1.17.0
13-
k8s.io/api v0.21.1
14-
k8s.io/apimachinery v0.21.1
15-
k8s.io/client-go v0.21.1
16-
k8s.io/utils v0.0.0-20210709001253-0e1f9d693477
17-
sigs.k8s.io/controller-runtime v0.9.0
13+
go.uber.org/zap v1.19.0
14+
golang.org/x/mod v0.5.1
15+
k8s.io/api v0.22.1
16+
k8s.io/apimachinery v0.22.1
17+
k8s.io/client-go v0.22.1
18+
k8s.io/utils v0.0.0-20210802155522-efc7438f0176
19+
sigs.k8s.io/controller-runtime v0.10.0
1820
)

0 commit comments

Comments
 (0)