@@ -62,23 +62,29 @@ defmodule SpawnOperator.K8s.Proxy.Deployment do
62
62
}
63
63
}
64
64
65
+ @ proto_volume % {
66
+ "name" => "shared-volume" ,
67
+ "emptyDir" => % { }
68
+ }
69
+
70
+
65
71
@ default_certs_volume % {
66
72
"name" => "certs" ,
67
73
"secret" => % { "secretName" => "tls-certs" , "optional" => true }
68
74
}
69
75
70
76
@ default_volumes [
71
- @ default_certs_volume
72
- ]
73
-
74
- @ proto_volume_mounts [
75
- % { "name" => "proto-volume" , "mountPath" => "/actors" }
77
+ @ default_certs_volume ,
78
+ @ proto_volume
76
79
]
77
80
78
81
@ default_certs_volume_mounts % { "name" => "certs" , "mountPath" => "/app/certs" }
79
82
83
+ @ default_proto_volume_mounts % { "name" => "shared-volume" , "mountPath" => "/shared" }
84
+
80
85
@ default_volume_mounts [
81
- @ default_certs_volume_mounts
86
+ @ default_certs_volume_mounts ,
87
+ @ default_proto_volume_mounts
82
88
]
83
89
84
90
@ default_termination_period_seconds 405
@@ -436,48 +442,21 @@ defmodule SpawnOperator.K8s.Proxy.Deployment do
436
442
Map . put ( spec , "terminationGracePeriodSeconds" , @ default_termination_period_seconds )
437
443
end
438
444
439
- defp maybe_put_volumes ( spec , % { "volumes" => volumes } = params ) do
440
- host_params = Map . get ( params , "host" )
441
- actor_host_function_image = Map . get ( host_params , "image" )
442
-
443
- proto_volume_mounts = [
444
- % {
445
- "name" => "proto-volume" ,
446
- "image" => % {
447
- "reference" => actor_host_function_image ,
448
- "pullPolicy" => "IfNotPresent"
449
- }
450
- }
451
- ]
452
-
445
+ defp maybe_put_volumes ( spec , % { "volumes" => volumes } = _params ) do
453
446
volumes =
454
447
( volumes ++
455
448
@ default_volumes )
456
- |> Kernel . ++ ( proto_volume_mounts )
457
449
|> List . flatten ( )
458
450
|> Enum . uniq ( & & 1 [ "name" ] )
459
451
460
452
Map . merge ( spec , % { "volumes" => volumes } )
461
453
end
462
454
463
- defp maybe_put_volumes ( spec , params ) do
464
- host_params = Map . get ( params , "host" )
465
- actor_host_function_image = Map . get ( host_params , "image" )
466
-
467
- proto_volume_mounts = [
468
- % {
469
- "name" => "proto-volume" ,
470
- "image" => % {
471
- "reference" => actor_host_function_image ,
472
- "pullPolicy" => "IfNotPresent"
473
- }
474
- }
475
- ]
476
-
455
+ defp maybe_put_volumes ( spec , _params ) do
477
456
volumes =
478
457
@ default_volumes
479
- |> Kernel . ++ ( proto_volume_mounts )
480
458
|> List . flatten ( )
459
+ |> Enum . uniq ( & & 1 [ "name" ] )
481
460
482
461
Map . put ( spec , "volumes" , volumes )
483
462
end
@@ -505,7 +484,6 @@ defmodule SpawnOperator.K8s.Proxy.Deployment do
505
484
volumeMounts =
506
485
volumeMounts
507
486
|> Kernel . ++ ( @ default_volume_mounts )
508
- |> Kernel . ++ ( @ proto_volume_mounts )
509
487
|> List . flatten ( )
510
488
|> Enum . uniq ( & & 1 [ "name" ] )
511
489
@@ -515,7 +493,6 @@ defmodule SpawnOperator.K8s.Proxy.Deployment do
515
493
defp maybe_put_volume_mounts_to_host_container ( spec , _ , :sidecar ) do
516
494
volumeMounts =
517
495
@ default_volume_mounts
518
- |> Kernel . ++ ( @ proto_volume_mounts )
519
496
|> List . flatten ( )
520
497
|> Enum . uniq ( & & 1 [ "name" ] )
521
498
0 commit comments