Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*.: fix default mysql version 5.7.33 to 5.7.34 #205

Merged
merged 1 commit into from
Sep 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
hustjieke marked this conversation as resolved.
Show resolved Hide resolved
}
)

Expand Down