Skip to content

Commit

Permalink
Added support for OCP 4.7 (#947)
Browse files Browse the repository at this point in the history
* Added support to provide mysql version while deploying mysql app

* Adding dbtemplate for OCP 4.7

* Adding support for integration test on OCP 4.7

* shifting OCP version from 4.5 to 4.7

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
chaitanya-baraskar and mergify[bot] committed Apr 6, 2021
1 parent 37d272f commit ac888eb
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DOCKER_CONFIG ?= "$(HOME)/.docker"
# Mention the vm-driver that should be used to install OpenShift
vm-driver ?= "kvm"
# Default OCP version in which the OpenShift apps are going to run
ocp_version ?= "4.5"
ocp_version ?= "4.7"
###
### These variables should not need tweaking.
###
Expand Down
4 changes: 4 additions & 0 deletions build/integration-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ SHORT_APPS="^PostgreSQL$|^PITRPostgreSQL|^MySQL$|Elasticsearch|^MongoDB$|Maria"
OC_APPS3_11="MysqlDBDepConfig$|MongoDBDepConfig$|PostgreSQLDepConfig$"
OC_APPS4_4="MysqlDBDepConfig4_4|MongoDBDepConfig4_4|PostgreSQLDepConfig4_4"
OC_APPS4_5="MysqlDBDepConfig4_5|MongoDBDepConfig4_5|PostgreSQLDepConfig4_5"
OC_APPS4_7="MysqlDBDepConfig4_7|MongoDBDepConfig4_7|PostgreSQLDepConfig4_7"

check_dependencies() {
# Check if minio is already deployed
Expand Down Expand Up @@ -84,6 +85,9 @@ case "${1}" in
"4.5")
TEST_APPS=${OC_APPS4_5}
;;
"4.7")
TEST_APPS=${OC_APPS4_7}
;;
*)
usage
;;
Expand Down
3 changes: 2 additions & 1 deletion pkg/app/mysql-deploymentconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,12 @@ type MysqlDepConfig struct {
dbTemplateVersion DBTemplate
}

func NewMysqlDepConfig(name string, templateVersion DBTemplate, storageType storage) App {
func NewMysqlDepConfig(name string, templateVersion DBTemplate, storageType storage, tag string) App {
return &MysqlDepConfig{
name: name,
params: map[string]string{
"MYSQL_ROOT_PASSWORD": "secretpassword",
"MYSQL_VERSION": tag,
},
storageType: storageType,
osClient: openshift.NewOpenShiftClient(),
Expand Down
2 changes: 2 additions & 0 deletions pkg/app/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ const (
TemplateVersionOCP4_4 DBTemplate = "release-4.4"
// TemplateVersionOCP4_5 stored version of db template 4.5
TemplateVersionOCP4_5 DBTemplate = "release-4.5"
// TemplateVersionOCP4_7 stoted version of db template 4.7
TemplateVersionOCP4_7 DBTemplate = "release-4.7"
)

type storage string
Expand Down
52 changes: 49 additions & 3 deletions pkg/testing/integration_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ var _ = Suite(&MysqlDBDepConfig{
IntegrationSuite{
name: "mysqldc",
namespace: "mysqldc-test",
app: app.NewMysqlDepConfig("mysqldeploymentconfig", app.TemplateVersionOCP3_11, app.EphemeralStorage),
app: app.NewMysqlDepConfig("mysqldeploymentconfig", app.TemplateVersionOCP3_11, app.EphemeralStorage, "5.7"),
bp: app.NewBlueprint("mysql-dep-config", ""),
profile: newSecretProfile(),
},
Expand Down Expand Up @@ -273,7 +273,7 @@ var _ = Suite(&MysqlDBDepConfig4_4{
IntegrationSuite{
name: "mysqldc",
namespace: "mysqldc4-4-test",
app: app.NewMysqlDepConfig("mysqldeploymentconfig", app.TemplateVersionOCP4_4, app.EphemeralStorage),
app: app.NewMysqlDepConfig("mysqldeploymentconfig", app.TemplateVersionOCP4_4, app.EphemeralStorage, "5.7"),
bp: app.NewBlueprint("mysql-dep-config", ""),
profile: newSecretProfile(),
},
Expand Down Expand Up @@ -319,7 +319,7 @@ var _ = Suite(&MysqlDBDepConfig4_5{
IntegrationSuite{
name: "mysqldc",
namespace: "mysqldc4-5-test",
app: app.NewMysqlDepConfig("mysqldeploymentconfig", app.TemplateVersionOCP4_5, app.EphemeralStorage),
app: app.NewMysqlDepConfig("mysqldeploymentconfig", app.TemplateVersionOCP4_5, app.EphemeralStorage, "5.7"),
bp: app.NewBlueprint("mysql-dep-config", ""),
profile: newSecretProfile(),
},
Expand Down Expand Up @@ -369,3 +369,49 @@ var _ = Suite(&Kafka{
profile: newSecretProfile(),
},
})

// OpenShift apps for version 4.7
// Mysql Instance that is deployed through DeploymentConfig on OpenShift cluster
type MysqlDBDepConfig4_7 struct {
IntegrationSuite
}

var _ = Suite(&MysqlDBDepConfig4_7{
IntegrationSuite{
name: "mysqldc",
namespace: "mysqldc4-7-test",
app: app.NewMysqlDepConfig("mysqldeploymentconfig", app.TemplateVersionOCP4_7, app.EphemeralStorage, "8.0"),
bp: app.NewBlueprint("mysql-dep-config", ""),
profile: newSecretProfile(),
},
})

// MongoDB deployed on openshift cluster
type MongoDBDepConfig4_7 struct {
IntegrationSuite
}

var _ = Suite(&MongoDBDepConfig4_7{
IntegrationSuite{
name: "mongodb",
namespace: "mongodb4-7-test",
app: app.NewMongoDBDepConfig("mongodeploymentconfig", app.TemplateVersionOCP4_7, app.EphemeralStorage),
bp: app.NewBlueprint("mongo-dep-config", ""),
profile: newSecretProfile(),
},
})

// PostgreSQL deployed on openshift cluster
type PostgreSQLDepConfig4_7 struct {
IntegrationSuite
}

var _ = Suite(&PostgreSQLDepConfig4_7{
IntegrationSuite{
name: "postgresdepconf",
namespace: "postgresdepconf4-5-test",
app: app.NewPostgreSQLDepConfig("postgresdepconf", app.TemplateVersionOCP4_7, app.EphemeralStorage),
bp: app.NewBlueprint("postgres-dep-config", ""),
profile: newSecretProfile(),
},
})

0 comments on commit ac888eb

Please sign in to comment.