@@ -280,12 +280,14 @@ def __init__(
280
280
enabled : bool = True ,
281
281
default_volumes : Optional [List [ConfigVolume ]] = None ,
282
282
pod_launch_timeout : Optional [int ] = None ,
283
+ watcher_kubeconfig_paths : Optional [List [str ]] = None ,
283
284
):
284
285
# general k8s config
285
286
self .kubeconfig_path = kubeconfig_path
286
287
self .enabled = enabled
287
288
self .default_volumes : Optional [List [ConfigVolume ]] = default_volumes or []
288
289
self .pod_launch_timeout = pod_launch_timeout or DEFAULT_POD_LAUNCH_TIMEOUT_S
290
+ self .watcher_kubeconfig_paths = watcher_kubeconfig_paths or []
289
291
# creating a task_proc executor has a couple steps:
290
292
# * create a TaskProcessor
291
293
# * load the desired plugin (in this case, the k8s one)
@@ -340,6 +342,7 @@ def get_runner(self, kubeconfig_path: str, queue: PyDeferredQueue) -> Optional[S
340
342
"namespace" : "tron" ,
341
343
"version" : __version__ ,
342
344
"kubeconfig_path" : self .kubeconfig_path ,
345
+ "watcher_kubeconfig_paths" : self .watcher_kubeconfig_paths ,
343
346
"task_configs" : [task .get_config () for task in self .tasks .values ()],
344
347
},
345
348
)
@@ -621,6 +624,7 @@ class KubernetesClusterRepository:
621
624
kubeconfig_path : Optional [str ] = None
622
625
pod_launch_timeout : Optional [int ] = None
623
626
default_volumes : Optional [List [ConfigVolume ]] = None
627
+ watcher_kubeconfig_paths : Optional [List [str ]] = None
624
628
625
629
# metadata config
626
630
clusters : Dict [str , KubernetesCluster ] = {}
@@ -643,7 +647,10 @@ def get_cluster(cls, kubeconfig_path: Optional[str] = None) -> Optional[Kubernet
643
647
if kubeconfig_path not in cls .clusters :
644
648
# will create the task_proc executor
645
649
cluster = KubernetesCluster (
646
- kubeconfig_path = kubeconfig_path , enabled = cls .kubernetes_enabled , default_volumes = cls .default_volumes
650
+ kubeconfig_path = kubeconfig_path ,
651
+ enabled = cls .kubernetes_enabled ,
652
+ default_volumes = cls .default_volumes ,
653
+ watcher_kubeconfig_paths = cls .watcher_kubeconfig_paths ,
647
654
)
648
655
cls .clusters [kubeconfig_path ] = cluster
649
656
@@ -659,6 +666,7 @@ def configure(cls, kubernetes_options: ConfigKubernetes) -> None:
659
666
cls .kubeconfig_path = kubernetes_options .kubeconfig_path
660
667
cls .kubernetes_enabled = kubernetes_options .enabled
661
668
cls .default_volumes = kubernetes_options .default_volumes
669
+ cls .watcher_kubeconfig_paths = kubernetes_options .watcher_kubeconfig_paths
662
670
663
671
for cluster in cls .clusters .values ():
664
672
cluster .set_enabled (cls .kubernetes_enabled )
0 commit comments