File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ class Job(NamespacedResource):
23
23
deleted (for example the pods left behind when you delete a Job). Options are: "Background",
24
24
"Foreground" and "Orphan". Read more here:
25
25
https://kubernetes.io/docs/concepts/architecture/garbage-collection/#cascading-deletion
26
+ volumes (list): List of volumes that can be mounted by containers belonging to the pod
26
27
"""
27
28
28
29
api_group = NamespacedResource .ApiGroup .BATCH
@@ -43,6 +44,7 @@ def __init__(
43
44
service_account = None ,
44
45
containers = None ,
45
46
background_propagation_policy = None ,
47
+ volumes = None ,
46
48
** kwargs ,
47
49
):
48
50
super ().__init__ (
@@ -59,6 +61,7 @@ def __init__(
59
61
self .service_account = service_account
60
62
self .containers = containers
61
63
self .background_propagation_policy = background_propagation_policy
64
+ self .volumes = volumes
62
65
63
66
def to_dict (self ) -> None :
64
67
super ().to_dict ()
@@ -78,6 +81,9 @@ def to_dict(self) -> None:
78
81
if self .restart_policy :
79
82
self .res ["spec" ]["template" ]["spec" ]["restartPolicy" ] = self .restart_policy
80
83
84
+ if self .volumes :
85
+ self .res ["spec" ]["template" ]["spec" ]["volumes" ] = self .volumes
86
+
81
87
def delete (self , wait = False , timeout = TIMEOUT_4MINUTES , body = None ):
82
88
"""
83
89
Delete Job object
You can’t perform that action at this time.
0 commit comments