Skip to content

Commit

Permalink
chore: fix golangci-lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
l-qing committed Mar 31, 2023
1 parent 5e6641f commit 4f97585
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
2 changes: 1 addition & 1 deletion pkg/reconciler/pipelinerun/resources/apply.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func replaceParamValues(params v1beta1.Params, stringReplacements map[string]str
// and omitted from the returned slice. A nil slice is returned if no results are passed in or all
// results are invalid.
func ApplyTaskResultsToPipelineResults(
ctx context.Context,
_ context.Context,
results []v1beta1.PipelineResult,
taskRunResults map[string][]v1beta1.TaskRunResult,
customTaskResults map[string][]v1beta1.CustomRunResult,
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/pipelinerun/resources/pipelineref.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func GetVerifiedPipelineFunc(ctx context.Context, k8s kubernetes.Interface, tekt
source = s.URI
}
if err := trustedresources.VerifyPipeline(ctx, p, k8s, source, verificationpolicies); err != nil {
return nil, nil, fmt.Errorf("GetVerifiedPipelineFunc failed: %w: %v", trustedresources.ErrResourceVerificationFailed, err)
return nil, nil, fmt.Errorf("GetVerifiedPipelineFunc failed: %w: %w", trustedresources.ErrResourceVerificationFailed, err)
}
return p, s, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/pipelinerun/resources/pipelineref_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ func simplePipelineWithSpecAndParam(pt v1beta1.ParamType) *v1beta1.Pipeline {
return p
}

func simplePipelineWithSpecParamAndKind(pt v1beta1.ParamType, tk v1beta1.TaskKind) *v1beta1.Pipeline {
func simplePipelineWithSpecParamAndKind(_ v1beta1.ParamType, _ v1beta1.TaskKind) *v1beta1.Pipeline {
p := simplePipelineWithBaseSpec()
p.Spec.Params = []v1beta1.ParamSpec{{
Name: "foo",
Expand Down
8 changes: 2 additions & 6 deletions pkg/reconciler/pipelinerun/resources/pipelinerunresolution.go
Original file line number Diff line number Diff line change
Expand Up @@ -665,11 +665,7 @@ func (t *ResolvedPipelineTask) resolvePipelineRunTaskWithTaskRun(
}
}

if err := t.resolveTaskResources(ctx, getTask, pipelineTask, taskRun); err != nil {
return err
}

return nil
return t.resolveTaskResources(ctx, getTask, pipelineTask, taskRun)
}

func (t *ResolvedPipelineTask) resolveTaskResources(
Expand Down Expand Up @@ -812,7 +808,7 @@ func getRunNamesFromChildRefs(childRefs []v1beta1.ChildStatusReference, ptName s

// resolvePipelineTaskResources matches PipelineResources referenced by pt inputs and outputs with the
// providedResources and returns an instance of ResolvedTask.
func resolvePipelineTaskResources(pt v1beta1.PipelineTask, ts *v1beta1.TaskSpec, taskName string, kind v1beta1.TaskKind) (*resources.ResolvedTask, error) {
func resolvePipelineTaskResources(_ v1beta1.PipelineTask, ts *v1beta1.TaskSpec, taskName string, kind v1beta1.TaskKind) (*resources.ResolvedTask, error) {
rtr := resources.ResolvedTask{
TaskName: taskName,
TaskSpec: ts,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package resources

import (
"fmt"
"strings"
"testing"

Expand All @@ -25,6 +24,7 @@ var (
Type: apis.ConditionSucceeded,
Status: corev1.ConditionFalse,
}
_ = failedCondition
)

var pipelineRunState = PipelineRunState{{
Expand Down Expand Up @@ -171,14 +171,6 @@ var pipelineRunState = PipelineRunState{{
},
}}

func resolvedSliceAsString(rs []*ResolvedResultRef) string {
var s []string
for _, r := range rs {
s = append(s, fmt.Sprintf("%#v", *r))
}
return fmt.Sprintf("[\n%s\n]", strings.Join(s, ",\n"))
}

func TestResolveResultRefs(t *testing.T) {
for _, tt := range []struct {
name string
Expand Down

0 comments on commit 4f97585

Please sign in to comment.