Skip to content

Commit

Permalink
fix: jobRunAsUser always removed in BatchGetJobEntity JobDetails (#349)
Browse files Browse the repository at this point in the history
Signed-off-by: Samuel Anderson <119458760+AWS-Samuel@users.noreply.github.com>
  • Loading branch information
AWS-Samuel authored Jul 5, 2024
1 parent c0dd3b3 commit b6a64de
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,9 @@ def validate_entity_data(
),
)

if job_user_override is not None:
if job_user_override is not None and (
job_user_override.run_as_agent or job_user_override.job_user
):
# If there is an override, we don't care about the job details jobRunAsUser
entity_data.pop("jobRunAsUser", None)
elif run_as_value := entity_data.get("jobRunAsUser", dict()).get("runAs", None):
Expand Down
4 changes: 3 additions & 1 deletion test/unit/sessions/job_entities/test_job_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,9 @@ def test_job_run_as_user(
}

# WHEN
job_details_data = JobDetails.validate_entity_data(api_response, job_user_override=None)
job_details_data = JobDetails.validate_entity_data(
api_response, job_user_override=JobsRunAsUserOverride(run_as_agent=False, job_user=None)
)
entity_obj = JobDetails.from_boto(job_details_data)

# THEN
Expand Down

0 comments on commit b6a64de

Please sign in to comment.