Skip to content

Commit

Permalink
*.: fix default mysql version 5.7.33 to 5.7.34 #200
Browse files Browse the repository at this point in the history
[summary]
change default mysql version to 5.7.34 and add it to tag list
  • Loading branch information
hustjieke committed Sep 9, 2021
1 parent 0c498e5 commit d7761d6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 15 deletions.
20 changes: 10 additions & 10 deletions cluster/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestGetLabel(t *testing.T) {
"mysql.radondb.com/cluster": "sample",
"app.kubernetes.io/name": "mysql",
"app.kubernetes.io/instance": "instance",
"app.kubernetes.io/version": "5.7.33",
"app.kubernetes.io/version": "5.7.34",
"app.kubernetes.io/component": "database",
"app.kubernetes.io/managed-by": "mysql.radondb.com",
}
Expand All @@ -93,7 +93,7 @@ func TestGetLabel(t *testing.T) {
"mysql.radondb.com/cluster": "sample",
"app.kubernetes.io/name": "mysql",
"app.kubernetes.io/instance": "sample",
"app.kubernetes.io/version": "5.7.33",
"app.kubernetes.io/version": "5.7.34",
"app.kubernetes.io/component": "component",
"app.kubernetes.io/managed-by": "mysql.radondb.com",
}
Expand All @@ -112,7 +112,7 @@ func TestGetLabel(t *testing.T) {
"mysql.radondb.com/cluster": "sample",
"app.kubernetes.io/name": "mysql",
"app.kubernetes.io/instance": "sample",
"app.kubernetes.io/version": "5.7.33",
"app.kubernetes.io/version": "5.7.34",
"app.kubernetes.io/component": "database",
"app.kubernetes.io/managed-by": "mysql.radondb.com",
"app.kubernetes.io/part-of": "part-of",
Expand All @@ -131,34 +131,34 @@ func TestGetSelectorLabels(t *testing.T) {
}

func TestGetMySQLVersion(t *testing.T) {
// other 8.0 -> 5.7.33
//other 8.0 -> 5.7.34
{
testMysqlCluster := mysqlCluster
testMysqlCluster.Spec.MysqlVersion = "8.0"
testCase := Cluster{
&testMysqlCluster,
}
want := "5.7.33"
want := "5.7.34"
assert.Equal(t, want, testCase.GetMySQLVersion())
}
// MySQLTagsToSemVer 5.7 -> 5.7.33
//MySQLTagsToSemVer 5.7 -> 5.7.34
{
testMysqlCluster := mysqlCluster
testMysqlCluster.Spec.MysqlVersion = "5.7"
testCase := Cluster{
&testMysqlCluster,
}
want := "5.7.33"
want := "5.7.34"
assert.Equal(t, want, testCase.GetMySQLVersion())
}
// MysqlImageVersions 5.7.33 -> 5.7.33
//MysqlImageVersions 5.7.34 -> 5.7.34
{
testMysqlCluster := mysqlCluster
testMysqlCluster.Spec.MysqlVersion = "5.7.33"
testMysqlCluster.Spec.MysqlVersion = "5.7.34"
testCase := Cluster{
&testMysqlCluster,
}
want := "5.7.33"
want := "5.7.34"
assert.Equal(t, want, testCase.GetMySQLVersion())
}
}
Expand Down
2 changes: 1 addition & 1 deletion cluster/container/init_mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ func TestGetInitMysqlName(t *testing.T) {
}

func TestGetInitMysqlImage(t *testing.T) {
assert.Equal(t, "percona/percona-server:5.7.33", initMysqlCase.Image)
assert.Equal(t, "percona/percona-server:5.7.34", initMysqlCase.Image)
}

func TestGetInitMysqlCommand(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion cluster/container/init_sidecar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ var (
},
{
Name: "MYSQL_VERSION",
Value: "5.7.33",
Value: "5.7.34",
},
{
Name: "RESTORE_FROM",
Expand Down
2 changes: 1 addition & 1 deletion cluster/container/mysql_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func TestGetMysqlName(t *testing.T) {
}

func TestGetMysqlImage(t *testing.T) {
assert.Equal(t, "percona/percona-server:5.7.33", mysqlCase.Image)
assert.Equal(t, "percona/percona-server:5.7.34", mysqlCase.Image)
}

func TestGetMysqlCommand(t *testing.T) {
Expand Down
5 changes: 3 additions & 2 deletions utils/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,17 @@ package utils

var (
// MySQLDefaultVersion is the version for mysql that should be used
MySQLDefaultVersion = "5.7.33"
MySQLDefaultVersion = "5.7.34"

// MySQLTagsToSemVer maps simple version to semver versions
MySQLTagsToSemVer = map[string]string{
"5.7": "5.7.33",
"5.7": "5.7.34",
}

// MysqlImageVersions is a map of supported mysql version and their image
MysqlImageVersions = map[string]string{
"5.7.33": "percona/percona-server:5.7.33",
"5.7.34": "percona/percona-server:5.7.34",
}
)

Expand Down

0 comments on commit d7761d6

Please sign in to comment.