diff --git a/mysqlcluster/container/backup.go b/mysqlcluster/container/backup.go index 8a401a49c..b42eae833 100644 --- a/mysqlcluster/container/backup.go +++ b/mysqlcluster/container/backup.go @@ -134,7 +134,6 @@ func (c *backupSidecar) getVolumeMounts() []corev1.VolumeMount { { Name: utils.DataVolumeName, MountPath: utils.DataVolumeMountPath, - SubPath: utils.MysqlDataSubPath, }, { Name: utils.LogsVolumeName, diff --git a/mysqlcluster/container/init_mysql.go b/mysqlcluster/container/init_mysql.go index b43992ef1..54c8b5412 100644 --- a/mysqlcluster/container/init_mysql.go +++ b/mysqlcluster/container/init_mysql.go @@ -115,7 +115,6 @@ func (c *initMysql) getVolumeMounts() []corev1.VolumeMount { { Name: utils.DataVolumeName, MountPath: utils.DataVolumeMountPath, - SubPath: utils.MysqlDataSubPath, }, { Name: utils.LogsVolumeName, diff --git a/mysqlcluster/container/init_mysql_test.go b/mysqlcluster/container/init_mysql_test.go index 6b51d9b4f..b855be1e9 100644 --- a/mysqlcluster/container/init_mysql_test.go +++ b/mysqlcluster/container/init_mysql_test.go @@ -59,7 +59,6 @@ var ( { Name: utils.DataVolumeName, MountPath: utils.DataVolumeMountPath, - SubPath: utils.MysqlDataSubPath, }, { Name: utils.LogsVolumeName, diff --git a/mysqlcluster/container/init_sidecar.go b/mysqlcluster/container/init_sidecar.go index f1e475020..d3d05a248 100644 --- a/mysqlcluster/container/init_sidecar.go +++ b/mysqlcluster/container/init_sidecar.go @@ -202,12 +202,10 @@ func (c *initSidecar) getVolumeMounts() []corev1.VolumeMount { corev1.VolumeMount{ Name: utils.DataVolumeName, MountPath: utils.DataVolumeMountPath, - SubPath: utils.MysqlDataSubPath, }, corev1.VolumeMount{ Name: utils.DataVolumeName, MountPath: utils.XenonDataVolumeMountPath, - SubPath: utils.XenonDataSubPath, }, ) } diff --git a/mysqlcluster/container/init_sidecar_test.go b/mysqlcluster/container/init_sidecar_test.go index 869818826..03b48563a 100644 --- a/mysqlcluster/container/init_sidecar_test.go +++ b/mysqlcluster/container/init_sidecar_test.go @@ -458,15 +458,11 @@ func TestGetInitSidecarVolumeMounts(t *testing.T) { persistenceVolumeMounts = append(persistenceVolumeMounts, corev1.VolumeMount{ Name: utils.DataVolumeName, - MountPath: utils.DataVolumeMountPath, - SubPath: utils.MysqlDataSubPath, - }, + MountPath: utils.DataVolumeMountPath}, corev1.VolumeMount{ Name: utils.DataVolumeName, MountPath: utils.XenonDataVolumeMountPath, - SubPath: utils.XenonDataSubPath, - }, - ) + }) assert.Equal(t, persistenceVolumeMounts, persistenceCase.VolumeMounts) } } diff --git a/mysqlcluster/container/mysql.go b/mysqlcluster/container/mysql.go index 8a00fd612..d01f9f275 100644 --- a/mysqlcluster/container/mysql.go +++ b/mysqlcluster/container/mysql.go @@ -141,7 +141,6 @@ func (c *mysql) getVolumeMounts() []corev1.VolumeMount { { Name: utils.DataVolumeName, MountPath: utils.DataVolumeMountPath, - SubPath: utils.MysqlDataSubPath, }, { Name: utils.LogsVolumeName, diff --git a/mysqlcluster/container/mysql_test.go b/mysqlcluster/container/mysql_test.go index 49dddb53a..e502021a1 100644 --- a/mysqlcluster/container/mysql_test.go +++ b/mysqlcluster/container/mysql_test.go @@ -147,7 +147,6 @@ func TestGetMysqlVolumeMounts(t *testing.T) { { Name: "data", MountPath: "/var/lib/mysql", - SubPath: "mysql", }, { Name: "logs", diff --git a/mysqlcluster/container/xenon.go b/mysqlcluster/container/xenon.go index f1bd5c150..6d19110b5 100644 --- a/mysqlcluster/container/xenon.go +++ b/mysqlcluster/container/xenon.go @@ -114,15 +114,14 @@ func (c *xenon) getVolumeMounts() []corev1.VolumeMount { Name: utils.ScriptsVolumeName, MountPath: utils.ScriptsVolumeMountPath, }, - { - Name: utils.DataVolumeName, - MountPath: utils.XenonDataVolumeMountPath, - SubPath: utils.XenonDataSubPath, - }, { Name: utils.XenonVolumeName, MountPath: utils.XenonVolumeMountPath, }, + { + Name: utils.DataVolumeName, + MountPath: utils.XenonDataVolumeMountPath, + }, { Name: utils.SysLocalTimeZone, MountPath: utils.SysLocalTimeZoneMountPath, diff --git a/mysqlcluster/container/xenon_test.go b/mysqlcluster/container/xenon_test.go index d67a18cfc..19f44798d 100644 --- a/mysqlcluster/container/xenon_test.go +++ b/mysqlcluster/container/xenon_test.go @@ -134,15 +134,14 @@ func TestGetXenonVolumeMounts(t *testing.T) { Name: "scripts", MountPath: "/scripts", }, - { - Name: "data", - MountPath: "/var/lib/xenon", - SubPath: "xenon", - }, { Name: "xenon", MountPath: "/etc/xenon", }, + { + Name: "data", + MountPath: "/var/lib/xenon", + }, { Name: utils.SysLocalTimeZone, MountPath: "/etc/localtime", diff --git a/sidecar/util.go b/sidecar/util.go index 71570dd10..4d97e96a2 100644 --- a/sidecar/util.go +++ b/sidecar/util.go @@ -45,6 +45,7 @@ var ( // dataPath is the mysql data path. dataPath = utils.DataVolumeMountPath + // xenonMetaDataPath is the xenon metadata path. xenonDataPath = utils.XenonDataVolumeMountPath diff --git a/utils/constants.go b/utils/constants.go index b291caabc..d7c12787e 100644 --- a/utils/constants.go +++ b/utils/constants.go @@ -108,8 +108,6 @@ const ( ScriptsVolumeMountPath = "/scripts" XenonVolumeMountPath = "/etc/xenon" InitFileVolumeMountPath = "/docker-entrypoint-initdb.d" - MysqlDataSubPath = "mysql" - XenonDataSubPath = "xenon" // Volume timezone name. SysLocalTimeZone = "localtime"