Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7508976

Browse files
committedJan 12, 2023
Fix PipelineRunStatus Reconciler for Minimal embeddedStatus
This commit fixes the updates for reconciling PipelineRunStatus when switching the DefaultEmbeddedStatus from `Full` to `Minimal`. The prior runs or taskruns status would not have been reset before this change.
1 parent c752a36 commit 7508976

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed
 

‎pkg/reconciler/pipelinerun/pipelinerun.go

+6
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ func (c *Reconciler) ReconcileKind(ctx context.Context, pr *v1beta1.PipelineRun)
204204
logger.Errorf("Failed to delete StatefulSet for PipelineRun %s: %v", pr.Name, err)
205205
return c.finishReconcileUpdateEmitEvents(ctx, pr, before, err)
206206
}
207+
207208
if err := c.updateTaskRunsStatusDirectly(pr); err != nil {
208209
logger.Errorf("Failed to update TaskRun status for PipelineRun %s: %v", pr.Name, err)
209210
return c.finishReconcileUpdateEmitEvents(ctx, pr, before, err)
@@ -1334,6 +1335,11 @@ func updatePipelineRunStatusFromChildObjects(ctx context.Context, logger *zap.Su
13341335
fullEmbedded := cfg.FeatureFlags.EmbeddedStatus == config.FullEmbeddedStatus || cfg.FeatureFlags.EmbeddedStatus == config.BothEmbeddedStatus
13351336
minimalEmbedded := cfg.FeatureFlags.EmbeddedStatus == config.MinimalEmbeddedStatus || cfg.FeatureFlags.EmbeddedStatus == config.BothEmbeddedStatus
13361337

1338+
if cfg.FeatureFlags.EmbeddedStatus == config.MinimalEmbeddedStatus {
1339+
pr.Status.TaskRuns = nil
1340+
pr.Status.Runs = nil
1341+
}
1342+
13371343
if minimalEmbedded {
13381344
updatePipelineRunStatusFromChildRefs(logger, pr, taskRuns, runObjects)
13391345
}

0 commit comments

Comments
 (0)
Please sign in to comment.