From 745a7e94ed395fe6411f67a56ef4756f3e4a0e8d Mon Sep 17 00:00:00 2001 From: Kevin Esslinger Date: Wed, 26 Aug 2026 12:48:18 +0200 Subject: [PATCH] enable argo hooks to inherit security context from start step --- metaflow/plugins/argo/argo_workflows.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/metaflow/plugins/argo/argo_workflows.py b/metaflow/plugins/argo/argo_workflows.py index b033c6d638f..d54963bb154 100644 --- a/metaflow/plugins/argo/argo_workflows.py +++ b/metaflow/plugins/argo/argo_workflows.py @@ -3147,6 +3147,13 @@ def _container(cmds): + ARGO_WORKFLOWS_KUBERNETES_SECRETS.split(",") if k ], + security_context=( + kubernetes_sdk.V1SecurityContext( + **resources["security_context"] + ) + if resources.get("security_context") + else None + ), resources=kubernetes_sdk.V1ResourceRequirements( requests={ "cpu": str(kube_defaults["cpu"]), @@ -3305,6 +3312,13 @@ def _error_msg_capture_hook_templates(self): + ARGO_WORKFLOWS_KUBERNETES_SECRETS.split(",") if k ], + security_context=( + kubernetes_sdk.V1SecurityContext( + **resources["security_context"] + ) + if resources.get("security_context") + else None + ), resources=kubernetes_sdk.V1ResourceRequirements( # NOTE: base resources for this are kept to a minimum to save on running costs. # This has an adverse effect on startup time for the daemon, which can be completely @@ -3796,6 +3810,13 @@ def _heartbeat_daemon_template(self): + ARGO_WORKFLOWS_KUBERNETES_SECRETS.split(",") if k ], + security_context=( + kubernetes_sdk.V1SecurityContext( + **resources["security_context"] + ) + if resources.get("security_context") + else None + ), resources=kubernetes_sdk.V1ResourceRequirements( # NOTE: base resources for this are kept to a minimum to save on running costs. # This has an adverse effect on startup time for the daemon, which can be completely