@@ -75,6 +75,7 @@ func (b *StorageInitJobBuilder) buildInitJobPodTemplateSpec() corev1.PodTemplate
7575 DNSConfig : & corev1.PodDNSConfig {
7676 Searches : dnsConfigSearches ,
7777 },
78+ InitContainers : b .Spec .InitContainers ,
7879 },
7980 }
8081
@@ -92,8 +93,7 @@ func (b *StorageInitJobBuilder) buildInitJobPodTemplateSpec() corev1.PodTemplate
9293 }
9394 }
9495
95- // InitContainer only needed for CaBundle manipulation for now,
96- // may be probably used for other stuff later
96+ // append an init container for updating the ca.crt if we have any certificates
9797 if b .AnyCertificatesAdded () {
9898 podTemplate .Spec .InitContainers = append (
9999 []corev1.Container {b .buildCaStorePatchingInitContainer ()},
@@ -137,7 +137,7 @@ func (b *StorageInitJobBuilder) buildInitJobVolumes() []corev1.Volume {
137137 }
138138
139139 if b .Spec .Service .GRPC .TLSConfiguration .Enabled {
140- volumes = append (volumes , buildTLSVolume (grpcTLSVolumeName , b .Spec .Service .GRPC .TLSConfiguration ))
140+ volumes = append (volumes , buildTLSVolume (GRPCTLSVolumeName , b .Spec .Service .GRPC .TLSConfiguration ))
141141 }
142142
143143 if b .Spec .OperatorConnection != nil {
@@ -153,6 +153,21 @@ func (b *StorageInitJobBuilder) buildInitJobVolumes() []corev1.Volume {
153153 })
154154 }
155155
156+ for _ , secret := range b .Spec .Secrets {
157+ volumes = append (volumes , corev1.Volume {
158+ Name : secret .Name ,
159+ VolumeSource : corev1.VolumeSource {
160+ Secret : & corev1.SecretVolumeSource {
161+ SecretName : secret .Name ,
162+ },
163+ },
164+ })
165+ }
166+
167+ for _ , volume := range b .Spec .Volumes {
168+ volumes = append (volumes , * volume )
169+ }
170+
156171 if b .AnyCertificatesAdded () {
157172 volumes = append (volumes , corev1.Volume {
158173 Name : systemCertsVolumeName ,
@@ -219,7 +234,7 @@ func (b *StorageInitJobBuilder) buildJobVolumeMounts() []corev1.VolumeMount {
219234
220235 if b .Spec .Service .GRPC .TLSConfiguration .Enabled {
221236 volumeMounts = append (volumeMounts , corev1.VolumeMount {
222- Name : grpcTLSVolumeName ,
237+ Name : GRPCTLSVolumeName ,
223238 ReadOnly : true ,
224239 MountPath : grpcTLSVolumeMountPath ,
225240 })
@@ -302,7 +317,7 @@ func (b *StorageInitJobBuilder) buildCaStorePatchingInitContainerVolumeMounts()
302317
303318 if b .Spec .Service .GRPC .TLSConfiguration .Enabled {
304319 volumeMounts = append (volumeMounts , corev1.VolumeMount {
305- Name : grpcTLSVolumeName ,
320+ Name : GRPCTLSVolumeName ,
306321 ReadOnly : true ,
307322 MountPath : grpcTLSVolumeMountPath ,
308323 })
0 commit comments