Skip to content

Commit

Permalink
Appease lint: unnecessary use of Sprintf and possible nil pointer der…
Browse files Browse the repository at this point in the history
…eference
  • Loading branch information
Scott committed Mar 25, 2020
1 parent 6f7d75a commit cbea028
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions pkg/reconciler/pipelinerun/pipelinerun_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -942,11 +942,11 @@ func TestReconcileWithTimeout(t *testing.T) {
actual := clients.Pipeline.Actions()[0].(ktesting.CreateAction).GetObject().(*v1alpha1.TaskRun)
if actual == nil {
t.Errorf("Expected a TaskRun to be created, but it wasn't.")
}

// The TaskRun timeout should be less than or equal to the PipelineRun timeout.
if actual.Spec.Timeout.Duration > prs[0].Spec.Timeout.Duration {
t.Errorf("TaskRun timeout %s should be less than or equal to PipelineRun timeout %s", actual.Spec.Timeout.Duration.String(), prs[0].Spec.Timeout.Duration.String())
} else {
// The TaskRun timeout should be less than or equal to the PipelineRun timeout.
if actual.Spec.Timeout.Duration > prs[0].Spec.Timeout.Duration {
t.Errorf("TaskRun timeout %s should be less than or equal to PipelineRun timeout %s", actual.Spec.Timeout.Duration.String(), prs[0].Spec.Timeout.Duration.String())
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/taskrun/taskrun.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ func (c *Reconciler) handlePodCreationError(tr *v1alpha1.TaskRun, err error) {
if tr.Spec.TaskRef != nil {
msg = fmt.Sprintf("Missing or invalid Task %s/%s", tr.Namespace, tr.Spec.TaskRef.Name)
} else {
msg = fmt.Sprintf("Invalid TaskSpec")
msg = "Invalid TaskSpec"
}
}
tr.Status.SetCondition(&apis.Condition{
Expand Down

0 comments on commit cbea028

Please sign in to comment.