Skip to content

Commit

Permalink
cleaning up function params
Browse files Browse the repository at this point in the history
Dropping unused context as the function parameter from GetPipelineTaskStatus()
  • Loading branch information
pritidesai authored and tekton-robot committed Mar 8, 2021
1 parent e78fa89 commit 3c9c35d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pkg/reconciler/pipelinerun/pipelinerun.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ func (c *Reconciler) runNextSchedulableTask(ctx context.Context, pr *v1beta1.Pip
fnextRprts := pipelineRunFacts.GetFinalTasks()
if len(fnextRprts) != 0 {
// apply the runtime context just before creating taskRuns for final tasks in queue
resources.ApplyPipelineTaskContext(fnextRprts, pipelineRunFacts.GetPipelineTaskStatus(ctx))
resources.ApplyPipelineTaskContext(fnextRprts, pipelineRunFacts.GetPipelineTaskStatus())

// Before creating TaskRun for scheduled final task, check if it's consuming a task result
// Resolve and apply task result wherever applicable, report warning in case resolution fails
Expand Down
3 changes: 1 addition & 2 deletions pkg/reconciler/pipelinerun/resources/pipelinerunstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package resources

import (
"context"
"fmt"

"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
Expand Down Expand Up @@ -393,7 +392,7 @@ func (facts *PipelineRunFacts) GetSkippedTasks() []v1beta1.SkippedTask {

// GetPipelineTaskStatus returns the status of a PipelineTask depending on its taskRun
// the checks are implemented such that the finally tasks are requesting status of the dag tasks
func (facts *PipelineRunFacts) GetPipelineTaskStatus(ctx context.Context) map[string]string {
func (facts *PipelineRunFacts) GetPipelineTaskStatus() map[string]string {
// construct a map of tasks.<pipelineTask>.status and its state
tStatus := make(map[string]string)
for _, t := range facts.State {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ limitations under the License.
package resources

import (
"context"
"fmt"
"testing"
"time"
Expand Down Expand Up @@ -1462,7 +1461,7 @@ func TestPipelineRunFacts_GetPipelineTaskStatus(t *testing.T) {
TasksGraph: d,
FinalTasksGraph: &dag.Graph{},
}
s := facts.GetPipelineTaskStatus(context.Background())
s := facts.GetPipelineTaskStatus()
if d := cmp.Diff(tc.expectedStatus, s); d != "" {
t.Fatalf("Test failed: %s Mismatch in pipelineTask execution state %s", tc.name, diff.PrintWantGot(d))
}
Expand Down

0 comments on commit 3c9c35d

Please sign in to comment.