Skip to content

Commit 49bc6c9

Browse files
authored
Fix lint issues (#3023)
1 parent 03f0e3a commit 49bc6c9

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

porch/apiserver/pkg/registry/porch/packagerevision.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func (r *packageRevisions) Create(ctx context.Context, runtimeObject runtime.Obj
107107

108108
repositoryName := obj.Spec.RepositoryName
109109
if repositoryName == "" {
110-
return nil, apierrors.NewBadRequest(fmt.Sprintf("spec.repositoryName is required"))
110+
return nil, apierrors.NewBadRequest("spec.repositoryName is required")
111111
}
112112

113113
var repositoryObj configapi.Repository

porch/func/internal/podevaluator.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
"time"
2424

2525
"github.com/GoogleContainerTools/kpt/porch/func/evaluator"
26-
pb "github.com/GoogleContainerTools/kpt/porch/func/evaluator"
2726
"github.com/google/go-containerregistry/pkg/authn"
2827
"github.com/google/go-containerregistry/pkg/name"
2928
"github.com/google/go-containerregistry/pkg/v1/remote"
@@ -72,7 +71,7 @@ func NewPodEvaluator(namespace, wrapperServerImage string) (Evaluator, error) {
7271
}, nil
7372
}
7473

75-
func (pe *podEvaluator) EvaluateFunction(ctx context.Context, req *pb.EvaluateFunctionRequest) (*pb.EvaluateFunctionResponse, error) {
74+
func (pe *podEvaluator) EvaluateFunction(ctx context.Context, req *evaluator.EvaluateFunctionRequest) (*evaluator.EvaluateFunctionResponse, error) {
7675
ref, err := name.ParseReference(req.Image)
7776
if err != nil {
7877
return nil, err
@@ -83,6 +82,10 @@ func (pe *podEvaluator) EvaluateFunction(ctx context.Context, req *pb.EvaluateFu
8382
}
8483
// TODO: cache the config file
8584
cf, err := img.ConfigFile()
85+
if err != nil {
86+
return nil, err
87+
}
88+
8689
cfg := cf.Config
8790
var fnCmd []string
8891
if len(cfg.Entrypoint) != 0 {

porch/repository/pkg/git/primitives_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"time"
2323

2424
"github.com/go-git/go-git/v5"
25-
gogit "github.com/go-git/go-git/v5"
2625
"github.com/go-git/go-git/v5/config"
2726
"github.com/go-git/go-git/v5/plumbing"
2827
"github.com/go-git/go-git/v5/plumbing/object"
@@ -403,7 +402,7 @@ func TestDeleteUpstreamBranches(t *testing.T) {
403402
// Refetch
404403
switch err := downstream.Fetch(&git.FetchOptions{
405404
RemoteName: OriginName,
406-
Tags: gogit.NoTags,
405+
Tags: git.NoTags,
407406
Prune: git.Prune,
408407
}); err {
409408
case nil, git.NoErrAlreadyUpToDate:

0 commit comments

Comments
 (0)