fix: ignore job-entity run-as value when agent has a job user override #346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What was the problem/requirement? (What/Why)
The worker agent was validating the
jobRunAsUser
field in theBatchGetJobEntity
API response, even when the worker agent was configured with a job user override.This would lead to issues if a queue was configured with only the opposite system type in the
jobRunAsUser
. For example, a linux worker with theposix_job_user
configuration receives a job, which has ajobRunAsUser
value of:Then the worker agent would throw an error here because there is no
posix
runAs
field available, even though it shouldn't matter due to the override.What was the solution? (How)
Ignore the
jobRunAsUser
field if the worker agent has a job user overrideWhat is the impact of this change?
The erroneous behavior above no longer occurs.
How was this change tested?
Unit tests added.
Tested on a CMF worker with and without this change.
Confirmed that the worker with this change had a successful job run, while the worker without this change encountered the
Expected "jobRunAs" -> "posix" to exist when "jobRunAs" -> "runAs" is "QUEUE_CONFIGURED_USER" but it was not present
errorWas this change documented?
No
Is this a breaking change?
No
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.