From efe5b0cde1d5b9af484f0da642a5b6574d81deec Mon Sep 17 00:00:00 2001 From: ByronHsu Date: Tue, 28 Feb 2023 13:52:13 -0800 Subject: [PATCH] Remove duplicate logic of resolveSecurityCtx in execution_manager (#531) Signed-off-by: byhsu Co-authored-by: byhsu --- pkg/manager/impl/execution_manager.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pkg/manager/impl/execution_manager.go b/pkg/manager/impl/execution_manager.go index e166fa217..4f4689715 100644 --- a/pkg/manager/impl/execution_manager.go +++ b/pkg/manager/impl/execution_manager.go @@ -393,11 +393,8 @@ func (m *ExecutionManager) getExecutionConfig(ctx context.Context, request *admi // K8sServiceAccount and IamRole is empty then get the values from the deprecated fields. resolvedAuthRole := resolveAuthRole(request, launchPlan) resolvedSecurityCtx := resolveSecurityCtx(ctx, workflowExecConfig.GetSecurityContext(), resolvedAuthRole) - if workflowExecConfig.GetSecurityContext() == nil && - (len(resolvedSecurityCtx.GetRunAs().GetK8SServiceAccount()) > 0 || - len(resolvedSecurityCtx.GetRunAs().GetIamRole()) > 0) { - workflowExecConfig.SecurityContext = resolvedSecurityCtx - } + workflowExecConfig.SecurityContext = resolvedSecurityCtx + // Merge the application config into workflowExecConfig. If even the deprecated fields are not set workflowExecConfig = util.MergeIntoExecConfig(workflowExecConfig, m.config.ApplicationConfiguration().GetTopLevelConfig()) // Explicitly set the security context if its nil since downstream we expect this settings to be available