Skip to content

Commit

Permalink
rename variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Yongxuanzhang committed Feb 1, 2022
1 parent 845ced8 commit 853fd90
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pkg/pod/entrypoint_lookup_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
"strings"
"testing"

"github.com/google/go-cmp/cmp"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/registry"
remotetest "github.com/tektoncd/pipeline/test"
Expand Down Expand Up @@ -118,20 +117,14 @@ metadata:
t.Errorf("digest %s is not a valid reference: %v", ref, err)
}

got, err := entrypointCache.get(ctx, imgRef, "ns", "", []corev1.LocalObjectReference{{Name: "secret"}})
id, err := entrypointCache.get(ctx, imgRef, "ns", "", []corev1.LocalObjectReference{{Name: "secret"}})

if err != nil {
t.Fatalf("Get: %v", err)
}

if got == nil {
if id == nil {
t.Fatalf("Failed to get image: %v", err)
}

want := strings.Split(ref, "sha256:")[1]

if diff := cmp.Diff(string(want), string(got.digest.Hex)); diff != "" {
t.Error(diff)
}

}

0 comments on commit 853fd90

Please sign in to comment.