Skip to content

Commit 10c82f3

Browse files
committed
replace all initImage fields with initContainer
1 parent 5e091a5 commit 10c82f3

File tree

16 files changed

+2946
-254
lines changed

16 files changed

+2946
-254
lines changed

api/v1alpha1/perconaservermysql_types.go

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@ type ContainerSpec struct {
180180

181181
type PodSpec struct {
182182
// +kubebuilder:validation:Required
183-
Size int32 `json:"size,omitempty"`
184-
Annotations map[string]string `json:"annotations,omitempty"`
185-
Labels map[string]string `json:"labels,omitempty"`
186-
VolumeSpec *VolumeSpec `json:"volumeSpec,omitempty"`
187-
InitImage string `json:"initImage,omitempty"`
183+
Size int32 `json:"size,omitempty"`
184+
Annotations map[string]string `json:"annotations,omitempty"`
185+
Labels map[string]string `json:"labels,omitempty"`
186+
VolumeSpec *VolumeSpec `json:"volumeSpec,omitempty"`
187+
InitContainer InitContainerSpec `json:"initContainer,omitempty"`
188188

189189
Affinity *PodAffinity `json:"affinity,omitempty"`
190190
TopologySpreadConstraints []corev1.TopologySpreadConstraint `json:"topologySpreadConstraints,omitempty"`
@@ -213,9 +213,8 @@ func (s PodSpec) GetTerminationGracePeriodSeconds() *int64 {
213213
return &gp
214214
}
215215

216-
// Retrieves the initialization image for the pod.
217-
func (s *PodSpec) GetInitImage() string {
218-
return s.InitImage
216+
func (s *PodSpec) GetInitSpec() InitContainerSpec {
217+
return s.InitContainer
219218
}
220219

221220
type PMMSpec struct {
@@ -231,7 +230,7 @@ type PMMSpec struct {
231230
type BackupSpec struct {
232231
Enabled bool `json:"enabled,omitempty"`
233232
Image string `json:"image"`
234-
InitImage string `json:"initImage,omitempty"`
233+
InitContainer InitContainerSpec `json:"initContainer,omitempty"`
235234
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
236235
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
237236
ServiceAccountName string `json:"serviceAccountName,omitempty"`
@@ -253,9 +252,8 @@ type BackupSchedule struct {
253252
StorageName string `json:"storageName,omitempty"`
254253
}
255254

256-
// Retrieves the initialization image for the backup.
257-
func (s *BackupSpec) GetInitImage() string {
258-
return s.InitImage
255+
func (s *BackupSpec) GetInitSpec() InitContainerSpec {
256+
return s.InitContainer
259257
}
260258

261259
type BackupStorageType string

api/v1alpha1/zz_generated.deepcopy.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)