@@ -136,6 +136,10 @@ func (b *StorageInitJobBuilder) buildInitJobVolumes() []corev1.Volume {
136
136
},
137
137
}
138
138
139
+ if b .Spec .Service .Interconnect .TLSConfiguration .Enabled {
140
+ volumes = append (volumes , buildTLSVolume (interconnectTLSVolumeName , b .Spec .Service .Interconnect .TLSConfiguration ))
141
+ }
142
+
139
143
if b .Spec .Service .GRPC .TLSConfiguration .Enabled {
140
144
volumes = append (volumes , buildTLSVolume (GRPCTLSVolumeName , b .Spec .Service .GRPC .TLSConfiguration ))
141
145
}
@@ -222,16 +226,7 @@ func (b *StorageInitJobBuilder) buildInitJobContainer() corev1.Container { // to
222
226
return container
223
227
}
224
228
225
- func (b * StorageInitJobBuilder ) buildJobVolumeMounts () []corev1.VolumeMount {
226
- volumeMounts := []corev1.VolumeMount {
227
- {
228
- Name : configVolumeName ,
229
- ReadOnly : true ,
230
- MountPath : fmt .Sprintf ("%s/%s" , api .ConfigDir , api .ConfigFileName ),
231
- SubPath : api .ConfigFileName ,
232
- },
233
- }
234
-
229
+ func (b * StorageInitJobBuilder ) appendTLSVolumeMounts (volumeMounts []corev1.VolumeMount ) []corev1.VolumeMount {
235
230
if b .Spec .Service .GRPC .TLSConfiguration .Enabled {
236
231
volumeMounts = append (volumeMounts , corev1.VolumeMount {
237
232
Name : GRPCTLSVolumeName ,
@@ -240,12 +235,11 @@ func (b *StorageInitJobBuilder) buildJobVolumeMounts() []corev1.VolumeMount {
240
235
})
241
236
}
242
237
243
- if b .Spec .OperatorConnection != nil {
244
- secretName := fmt .Sprintf (OperatorTokenSecretNameFormat , b .Storage .Name )
238
+ if b .Spec .Service .Interconnect .TLSConfiguration .Enabled {
245
239
volumeMounts = append (volumeMounts , corev1.VolumeMount {
246
- Name : operatorTokenVolumeName ,
240
+ Name : interconnectTLSVolumeName ,
247
241
ReadOnly : true ,
248
- MountPath : fmt . Sprintf ( "%s/%s" , wellKnownDirForAdditionalSecrets , secretName ) ,
242
+ MountPath : interconnectTLSVolumeMountPath ,
249
243
})
250
244
}
251
245
@@ -260,6 +254,29 @@ func (b *StorageInitJobBuilder) buildJobVolumeMounts() []corev1.VolumeMount {
260
254
MountPath : systemCertsDir ,
261
255
})
262
256
}
257
+ return volumeMounts
258
+ }
259
+
260
+ func (b * StorageInitJobBuilder ) buildJobVolumeMounts () []corev1.VolumeMount {
261
+ volumeMounts := []corev1.VolumeMount {
262
+ {
263
+ Name : configVolumeName ,
264
+ ReadOnly : true ,
265
+ MountPath : fmt .Sprintf ("%s/%s" , api .ConfigDir , api .ConfigFileName ),
266
+ SubPath : api .ConfigFileName ,
267
+ },
268
+ }
269
+
270
+ if b .Spec .OperatorConnection != nil {
271
+ secretName := fmt .Sprintf (OperatorTokenSecretNameFormat , b .Storage .Name )
272
+ volumeMounts = append (volumeMounts , corev1.VolumeMount {
273
+ Name : operatorTokenVolumeName ,
274
+ ReadOnly : true ,
275
+ MountPath : fmt .Sprintf ("%s/%s" , wellKnownDirForAdditionalSecrets , secretName ),
276
+ })
277
+ }
278
+
279
+ volumeMounts = b .appendTLSVolumeMounts (volumeMounts )
263
280
264
281
return volumeMounts
265
282
}
@@ -301,29 +318,7 @@ func (b *StorageInitJobBuilder) buildCaStorePatchingInitContainer() corev1.Conta
301
318
}
302
319
303
320
func (b * StorageInitJobBuilder ) buildCaStorePatchingInitContainerVolumeMounts () []corev1.VolumeMount {
304
- volumeMounts := []corev1.VolumeMount {}
305
-
306
- if b .AnyCertificatesAdded () {
307
- volumeMounts = append (volumeMounts , corev1.VolumeMount {
308
- Name : localCertsVolumeName ,
309
- MountPath : localCertsDir ,
310
- })
311
-
312
- volumeMounts = append (volumeMounts , corev1.VolumeMount {
313
- Name : systemCertsVolumeName ,
314
- MountPath : systemCertsDir ,
315
- })
316
- }
317
-
318
- if b .Spec .Service .GRPC .TLSConfiguration .Enabled {
319
- volumeMounts = append (volumeMounts , corev1.VolumeMount {
320
- Name : GRPCTLSVolumeName ,
321
- ReadOnly : true ,
322
- MountPath : grpcTLSVolumeMountPath ,
323
- })
324
- }
325
-
326
- return volumeMounts
321
+ return b .appendTLSVolumeMounts ([]corev1.VolumeMount {})
327
322
}
328
323
329
324
func (b * StorageInitJobBuilder ) buildBlobStorageInitCommandArgs () ([]string , []string ) {
0 commit comments