File tree Expand file tree Collapse file tree 2 files changed +14
-10
lines changed
crates/stackable-operator/src/builder/pod Expand file tree Collapse file tree 2 files changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -300,6 +300,12 @@ impl ContainerBuilder {
300
300
}
301
301
302
302
pub fn build ( & self ) -> Container {
303
+ let volume_mounts = if self . volume_mounts . is_empty ( ) {
304
+ None
305
+ } else {
306
+ Some ( self . volume_mounts . values ( ) . cloned ( ) . collect ( ) )
307
+ } ;
308
+
303
309
Container {
304
310
args : self . args . clone ( ) ,
305
311
command : self . command . clone ( ) ,
@@ -309,11 +315,7 @@ impl ContainerBuilder {
309
315
resources : self . resources . clone ( ) ,
310
316
name : self . name . clone ( ) ,
311
317
ports : self . container_ports . clone ( ) ,
312
- volume_mounts : if self . volume_mounts . is_empty ( ) {
313
- None
314
- } else {
315
- Some ( self . volume_mounts . clone ( ) . into_values ( ) . collect ( ) )
316
- } ,
318
+ volume_mounts,
317
319
readiness_probe : self . readiness_probe . clone ( ) ,
318
320
liveness_probe : self . liveness_probe . clone ( ) ,
319
321
startup_probe : self . startup_probe . clone ( ) ,
Original file line number Diff line number Diff line change @@ -560,6 +560,12 @@ impl PodBuilder {
560
560
}
561
561
562
562
fn build_spec ( & self ) -> PodSpec {
563
+ let volumes = if self . volumes . is_empty ( ) {
564
+ None
565
+ } else {
566
+ Some ( self . volumes . values ( ) . cloned ( ) . collect ( ) )
567
+ } ;
568
+
563
569
let pod_spec = PodSpec {
564
570
containers : self . containers . clone ( ) ,
565
571
host_network : self . host_network ,
@@ -573,11 +579,7 @@ impl PodBuilder {
573
579
} ) ,
574
580
security_context : self . security_context . clone ( ) ,
575
581
tolerations : self . tolerations . clone ( ) ,
576
- volumes : if self . volumes . is_empty ( ) {
577
- None
578
- } else {
579
- Some ( self . volumes . clone ( ) . into_values ( ) . collect ( ) )
580
- } ,
582
+ volumes,
581
583
// Legacy feature for ancient Docker images
582
584
// In practice, this just causes a bunch of unused environment variables that may conflict with other uses,
583
585
// such as https://github.com/stackabletech/spark-operator/pull/256.
You can’t perform that action at this time.
0 commit comments