Repository navigation
fix: system executor fails trigger on cm/secret create errors and reads active job conditions - #7100
Open
prakash100198 wants to merge 1 commit into
Open
prakash100198 wants to merge 1 commit into
prakash100198 wants to merge 1 commit into
Conversation
…ds active job conditions - return cm/secret create errors (other than AlreadyExists) instead of resuming the job, and delete the still-suspended job - derive workflow status from an active Complete/Failed job condition instead of Conditions[0] Fixes #7080 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
prakash100198
requested review from
prakarsh-dt and
vivek-devtron
as code owners
November 27, 2026 05:25
|
Bito Automatic Review Skipped - Branch Excluded |
|
This branch has not been deployed
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
Fixes #7080
Two bugs in
SystemWorkflowExecutorImpl, the executor used when the workflow executor type isSYSTEM(Kubernetes Jobs instead of Argo).1. ConfigMap/Secret create errors were ignored.
createCmAndSecretslogged them "but ignoring" and the Job was resumed anyway. The pod then sits inCreateContainerConfigErroruntil the active deadline, and the build looks stuck with no reason shown.AlreadyExists. The still-suspended Job is deleted with foreground propagation, so any cm/secret it already owns is garbage-collected. The CI and pre/post-CD triggers already mark the run Failed with the error message.AlreadyExistsis still tolerated, as before. The object is there, so the pod can start, and failing on it would turn today's working runs into failures.createstep fails the workflow before the main step runs.2.
GetWorkflowStatusreturnedConditions[0].Typewhatever its status. A resumed Job keepsSuspended=Falseas its first condition. On k8s 1.31+ the job controller also addsSuccessCriteriaMet/FailureTargetbeforeComplete/Failed. So the status wasSuspendedeven for finished Jobs.UpdateCiWorkflowStatusFailure). It compares the status withFailedto detect deleted pods and to auto-retry viaHandlePodDeleted, and that comparison never matched.Complete/Failedcondition if there is one, else the latest active condition. Inactive conditions are skipped.Only
pkg/pipeline/executors/systemWorkflow.gochanges. No API, schema or Wire changes.How Has This Been Tested?
Unit tests (
systemWorkflow_test.go, new): an httptest fake API records every call. 11 ExecuteWorkflow cases (happy path, external cm/secret, forbidden/invalid/500 on cm or secret,AlreadyExists, cleanup failure, Job already gone), 11 job-condition cases, and GetWorkflowStatus.develop: exactly the 6 error-path cases and the status case fail. The happy path andAlreadyExistscases pass on both, so behaviour there is unchanged.Real-cluster E2E on GKE 1.35, also run on the enterprise copy of this file with identical results: the actual executor against a live API server, job controller, RBAC and GC, using throwaway namespaces (deleted afterwards). The forbidden cases use a ServiceAccount without cm or secret
create.SuspendedCompleteSuspendedFailedSuspended, cron does not treat as pod-deletedFailed, cron treats as pod-deletedSuspendedCompleteCreateContainerConfigError, Job and secret left behindForbiddenreturned, Job and secret removedCreateContainerConfigError, Job and cm left behindForbiddenreturned, Job and cm removedTerminal conditions seen on both:
[Suspended=False, SuccessCriteriaMet=True, Complete=True]and[Suspended=False, FailureTarget=True, Failed=True]. Pod outcomes and conditions are identical between the two runs. Only the rows above differ.Checklist:
Does this PR introduce a user-facing change?
🤖 Generated with Claude Code