@@ -53,25 +53,7 @@ func StatefulSet(g *mariadbv1.Galera) *appsv1.StatefulSet {
5353 },
5454 },
5555 }},
56- VolumeMounts : []corev1.VolumeMount {{
57- MountPath : "/var/lib/mysql" ,
58- Name : "mysql-db" ,
59- }, {
60- MountPath : "/var/lib/config-data" ,
61- ReadOnly : true ,
62- Name : "config-data" ,
63- }, {
64- MountPath : "/var/lib/pod-config-data" ,
65- Name : "pod-config-data" ,
66- }, {
67- MountPath : "/var/lib/operator-scripts" ,
68- ReadOnly : true ,
69- Name : "operator-scripts" ,
70- }, {
71- MountPath : "/var/lib/kolla/config_files" ,
72- ReadOnly : true ,
73- Name : "kolla-config" ,
74- }},
56+ VolumeMounts : getGaleraInitVolumeMounts (g ),
7557 }},
7658 Containers : []corev1.Container {{
7759 Image : g .Spec .ContainerImage ,
@@ -84,16 +66,6 @@ func StatefulSet(g *mariadbv1.Galera) *appsv1.StatefulSet {
8466 }, {
8567 Name : "KOLLA_CONFIG_STRATEGY" ,
8668 Value : "COPY_ALWAYS" ,
87- }, {
88- Name : "DB_ROOT_PASSWORD" ,
89- ValueFrom : & corev1.EnvVarSource {
90- SecretKeyRef : & corev1.SecretKeySelector {
91- LocalObjectReference : corev1.LocalObjectReference {
92- Name : g .Spec .Secret ,
93- },
94- Key : "DbRootPassword" ,
95- },
96- },
9769 }},
9870 Ports : []corev1.ContainerPort {{
9971 ContainerPort : 3306 ,
@@ -102,29 +74,7 @@ func StatefulSet(g *mariadbv1.Galera) *appsv1.StatefulSet {
10274 ContainerPort : 4567 ,
10375 Name : "galera" ,
10476 }},
105- VolumeMounts : []corev1.VolumeMount {{
106- MountPath : "/var/lib/mysql" ,
107- Name : "mysql-db" ,
108- }, {
109- MountPath : "/var/lib/config-data" ,
110- ReadOnly : true ,
111- Name : "config-data" ,
112- }, {
113- MountPath : "/var/lib/pod-config-data" ,
114- Name : "pod-config-data" ,
115- }, {
116- MountPath : "/var/lib/secrets" ,
117- ReadOnly : true ,
118- Name : "secrets" ,
119- }, {
120- MountPath : "/var/lib/operator-scripts" ,
121- ReadOnly : true ,
122- Name : "operator-scripts" ,
123- }, {
124- MountPath : "/var/lib/kolla/config_files" ,
125- ReadOnly : true ,
126- Name : "kolla-config" ,
127- }},
77+ VolumeMounts : getGaleraVolumeMounts (g ),
12878 StartupProbe : & corev1.Probe {
12979 ProbeHandler : corev1.ProbeHandler {
13080 Exec : & corev1.ExecAction {
@@ -149,92 +99,7 @@ func StatefulSet(g *mariadbv1.Galera) *appsv1.StatefulSet {
14999 },
150100 },
151101 }},
152- Volumes : []corev1.Volume {
153- {
154- Name : "secrets" ,
155- VolumeSource : corev1.VolumeSource {
156- Secret : & corev1.SecretVolumeSource {
157- SecretName : g .Spec .Secret ,
158- Items : []corev1.KeyToPath {
159- {
160- Key : "DbRootPassword" ,
161- Path : "dbpassword" ,
162- },
163- },
164- },
165- },
166- },
167- {
168- Name : "kolla-config" ,
169- VolumeSource : corev1.VolumeSource {
170- ConfigMap : & corev1.ConfigMapVolumeSource {
171- LocalObjectReference : corev1.LocalObjectReference {
172- Name : g .Name + "-config-data" ,
173- },
174- Items : []corev1.KeyToPath {
175- {
176- Key : "config.json" ,
177- Path : "config.json" ,
178- },
179- },
180- },
181- },
182- },
183- {
184- Name : "pod-config-data" ,
185- VolumeSource : corev1.VolumeSource {
186- EmptyDir : & corev1.EmptyDirVolumeSource {},
187- },
188- },
189- {
190- Name : "config-data" ,
191- VolumeSource : corev1.VolumeSource {
192- ConfigMap : & corev1.ConfigMapVolumeSource {
193- LocalObjectReference : corev1.LocalObjectReference {
194- Name : g .Name + "-config-data" ,
195- },
196- Items : []corev1.KeyToPath {
197- {
198- Key : "galera.cnf.in" ,
199- Path : "galera.cnf.in" ,
200- },
201- {
202- Key : mariadbv1 .CustomServiceConfigFile ,
203- Path : mariadbv1 .CustomServiceConfigFile ,
204- },
205- },
206- },
207- },
208- },
209- {
210- Name : "operator-scripts" ,
211- VolumeSource : corev1.VolumeSource {
212- ConfigMap : & corev1.ConfigMapVolumeSource {
213- LocalObjectReference : corev1.LocalObjectReference {
214- Name : g .Name + "-scripts" ,
215- },
216- Items : []corev1.KeyToPath {
217- {
218- Key : "mysql_bootstrap.sh" ,
219- Path : "mysql_bootstrap.sh" ,
220- },
221- {
222- Key : "mysql_probe.sh" ,
223- Path : "mysql_probe.sh" ,
224- },
225- {
226- Key : "detect_last_commit.sh" ,
227- Path : "detect_last_commit.sh" ,
228- },
229- {
230- Key : "detect_gcomm_and_start.sh" ,
231- Path : "detect_gcomm_and_start.sh" ,
232- },
233- },
234- },
235- },
236- },
237- },
102+ Volumes : getGaleraVolumes (g ),
238103 },
239104 },
240105 VolumeClaimTemplates : []corev1.PersistentVolumeClaim {
0 commit comments