fix: Update the k8s Job container logic for custom actions to match v… #9584
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.
…erify
Fixes #9409
Description
This PR updates the logic when it comes to custom actions with a provided Job manifest to be similar to verify. What this means is that any container fields defined in the Job manifest that are not configurable in the customActions stanza are kept, e.g.
volumes
. It also appends env vars rather than replacing to be consistent with verify as well.Frankly, I'm not sure why the Job execution for verify and custom actions were implemented in two different places which caused these deviations. I suspect there are other ways in which they differ, just from a quick glance at the two implementations.
Unfortunately, it also looks like executing the k8s Jobs for verify and custom actions lacks unit testing. In order to get this in I've just gone ahead and added a very basic test for the container patching logic, same as what exists for verify here.
User facing changes (remove if N/A)
Any fields that are defined in the Job container manifest that are not configurable in the customActions container stanza will be kept. In other words, any fields that are not name, image, command, or args.