Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Finish up removal of Conditions 🧹 #5027

Merged
merged 1 commit into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions pkg/apis/pipeline/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,6 @@ const (
// PipelineTaskLabelKey is used as the label identifier for a PipelineTask
PipelineTaskLabelKey = GroupName + "/pipelineTask"

// ConditionCheckKey is used as the label identifier for a ConditionCheck
ConditionCheckKey = GroupName + "/conditionCheck"

// ConditionNameKey is used as the label identifier for a Condition
ConditionNameKey = GroupName + "/conditionName"

// RunKey is used as the label identifier for a Run
RunKey = GroupName + "/run"

Expand Down
3 changes: 0 additions & 3 deletions pkg/reconciler/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ const (
// ReasonCouldntGetResource indicates that the reason for the failure status is that the
// associated PipelineRun's bound PipelineResources couldn't all be retrieved
ReasonCouldntGetResource = "CouldntGetResource"
// ReasonCouldntGetCondition indicates that the reason for the failure status is that the
// associated Pipeline's Conditions couldn't all be retrieved
ReasonCouldntGetCondition = "CouldntGetCondition"
// ReasonParameterMissing indicates that the reason for the failure status is that the
// associated PipelineRun didn't provide all the required parameters
ReasonParameterMissing = "ParameterMissing"
Expand Down
9 changes: 2 additions & 7 deletions pkg/reconciler/pipelinerun/resources/pipelinerunstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,14 +321,9 @@ func (state PipelineRunState) getRetryableTasks(candidateTasks sets.String) []*R
isCancelled = isCancelled || status.Reason == v1alpha1.RunReasonCancelled
}
}
if status.IsFalse() {
if !(isCancelled || status.Reason == ReasonConditionCheckFailed) {
if t.hasRemainingRetries() {
tasks = append(tasks, t)
}
}
if status.IsFalse() && !isCancelled && t.hasRemainingRetries() {
tasks = append(tasks, t)
}

}
}
return tasks
Expand Down
18 changes: 0 additions & 18 deletions test/pipelinefinally_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,6 @@ spec:
t.Errorf("Error waiting for TaskRun to succeed: %v", err)
}
dagTask2EndTime = taskrunItem.Status.CompletionTime
case n == "dagtask3":
if !isSkipped(t, n, taskrunItem.Status.Conditions) {
t.Fatalf("dag task %s should have skipped due to condition failure", n)
}
Comment on lines -269 to -272
Copy link
Member Author

@jerop jerop Jun 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for reviewers' convenience, "dagtask3" was migrated to use when expressions and is in skipped tasks section of pipelinerun status now - see line 342 to line 349

case n == "dagtask4":
t.Fatalf("task %s should have skipped due to when expression", n)
case n == "dagtask5":
Expand Down Expand Up @@ -720,20 +716,6 @@ func isCancelled(t *testing.T, taskRunName string, conds duckv1beta1.Conditions)
return false
}

func isSkipped(t *testing.T, taskRunName string, conds duckv1beta1.Conditions) bool {
t.Helper()
for _, c := range conds {
if c.Type == apis.ConditionSucceeded {
if c.Status != corev1.ConditionFalse && c.Reason != resources.ReasonConditionCheckFailed {
t.Errorf("TaskRun status %q is not skipped due to condition failure, got %q", taskRunName, c.Status)
}
return true
}
}
t.Errorf("TaskRun status %q had no Succeeded condition", taskRunName)
return false
}

func getSuccessTask(t *testing.T, namespace string) *v1beta1.Task {
return parse.MustParseTask(t, fmt.Sprintf(`
metadata:
Expand Down