Skip to content
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
1 change: 1 addition & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
* Add `initBucketURL` and `initBucketSecretName` options to MysqlCluster chart. This bumps the chart version to `0.3.0`
### Changed
* Only add `binlog-space-limit` for `percona` image
* Make user-defined InitContainer take the precedence
* Set timeout of 15s on connection between the operator and Orchestrator
* Bump controller-util dependency to 0.1.18 which fixes some updates on pod spec.
* Removed `NO_AUTO_VALUE_ON_ZERO` from `sql-mode` to be inline with MySQL default value
Expand Down
23 changes: 12 additions & 11 deletions pkg/controller/mysqlcluster/internal/syncer/statefullset.go
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,20 @@ func (s *sfsSyncer) getEnvFor(name string) []core.EnvVar {
}

func (s *sfsSyncer) ensureInitContainersSpec() []core.Container {
initCs := []core.Container{
// clone and init container
s.ensureContainer(containerCloneAndInitName,
s.opt.SidecarImage,
[]string{"clone-and-init"},
),
initCs := []core.Container{}

// add user defined init containers
if len(s.cluster.Spec.PodSpec.InitContainers) > 0 {
initCs = append(initCs, s.cluster.Spec.PodSpec.InitContainers...)
}

// clone and init container
cloneInit := s.ensureContainer(containerCloneAndInitName,
s.opt.SidecarImage,
[]string{"clone-and-init"},
)
initCs = append(initCs, cloneInit)

// add init container for MySQL if docker image supports this
if s.cluster.ShouldHaveInitContainerForMysql() {
mysqlInit := s.ensureContainer(containerMySQLInitName,
Expand All @@ -341,11 +347,6 @@ func (s *sfsSyncer) ensureInitContainersSpec() []core.Container {
initCs = append(initCs, mysqlInit)
}

// add user defined init containers
if len(s.cluster.Spec.PodSpec.InitContainers) > 0 {
initCs = append(initCs, s.cluster.Spec.PodSpec.InitContainers...)
}

return initCs
}

Expand Down