Ensure dependent resources exist before creating job - #352
Merged
Conversation
brandond
force-pushed
the
apply-job-last
branch
9 times, most recently
from
September 2, 2026 03:53
9db48f1 to
5625a7e
Compare
brandond
force-pushed
the
apply-job-last
branch
2 times, most recently
from
September 2, 2026 05:56
167ea91 to
8a6c574
Compare
manuelbuil
approved these changes
Sep 2, 2026
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Apply sorts objects by GVK and applies them in groups by type, so we cannot simply pass the job last and rely on it returning early from an error if some resources cannot be created. We need to explicitly ensure their existence first, and sync the job separately. Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
brandond
force-pushed
the
apply-job-last
branch
from
September 2, 2026 18:24
8a6c574 to
cded766
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description:
Do not create job if dependent resources (values secret, content configmap, serviceaccount, clusterrolebinding) cannot be created.
Adds a test that blocks configmap and serviceaccount creation with ValidatingAdmissionPolicy, and ensures that the job is not created until the policy is deleted and the required resources can be created successfully.
Manual two-stage apply requires switching the OnChange handler from
GeneratingHandlertoStatusHandler, and configuring and running the Apply ourselves instead of just returning an object list and letting Wrangler muddle through it.This also converts over to running tests with ginkgo directly, as recommended by that project.
Linked Issue: