File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ class Job(NamespacedResource):
2323 deleted (for example the pods left behind when you delete a Job). Options are: "Background",
2424 "Foreground" and "Orphan". Read more here:
2525 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
2627 """
2728
2829 api_group = NamespacedResource .ApiGroup .BATCH
@@ -43,6 +44,7 @@ def __init__(
4344 service_account = None ,
4445 containers = None ,
4546 background_propagation_policy = None ,
47+ volumes = None ,
4648 ** kwargs ,
4749 ):
4850 super ().__init__ (
@@ -59,6 +61,7 @@ def __init__(
5961 self .service_account = service_account
6062 self .containers = containers
6163 self .background_propagation_policy = background_propagation_policy
64+ self .volumes = volumes
6265
6366 def to_dict (self ) -> None :
6467 super ().to_dict ()
@@ -78,6 +81,9 @@ def to_dict(self) -> None:
7881 if self .restart_policy :
7982 self .res ["spec" ]["template" ]["spec" ]["restartPolicy" ] = self .restart_policy
8083
84+ if self .volumes :
85+ self .res ["spec" ]["template" ]["spec" ]["volumes" ] = self .volumes
86+
8187 def delete (self , wait = False , timeout = TIMEOUT_4MINUTES , body = None ):
8288 """
8389 Delete Job object
You can’t perform that action at this time.
0 commit comments