File tree Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Expand file tree Collapse file tree 2 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -57,6 +57,11 @@ type MysqlClusterSpec struct {
5757 // +optional
5858 Image string `json:"image,omitempty"`
5959
60+ // To specify the image that will be used for sidecar container.
61+ // It will override --sidecar-image or --sidecar-mysql8-image flags.
62+ // +optional
63+ SidecarImage string `json:"sidecarImage,omitempty"`
64+
6065 // A bucket URL that contains a xtrabackup to initialize the mysql database.
6166 // +optional
6267 InitBucketURL string `json:"initBucketURL,omitempty"`
Original file line number Diff line number Diff line change @@ -268,13 +268,14 @@ func (c *MysqlCluster) GetNamespacedName() types.NamespacedName {
268268
269269// GetSidecarImage selects the sidecar docker image based on mysql version
270270func (c * MysqlCluster ) GetSidecarImage () string {
271+ if c .Spec .SidecarImage != "" {
272+ return c .Spec .SidecarImage
273+ }
271274 // decide the sidecar image based on mysql version
272- sidecarImage := options .GetOptions ().SidecarMysql57Image
273275 if c .GetMySQLSemVer ().Major == 8 {
274- sidecarImage = options .GetOptions ().SidecarMysql8Image
276+ return options .GetOptions ().SidecarMysql8Image
275277 }
276-
277- return sidecarImage
278+ return options .GetOptions ().SidecarMysql57Image
278279}
279280
280281// IsClusterReady checks if the cluster is ready or not.
You can’t perform that action at this time.
0 commit comments