Skip to content

Commit

Permalink
test: ecr arn image ref (#245)
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <hen.keinan@gmail.com>
  • Loading branch information
chen-keinan authored Nov 8, 2023
1 parent 1337219 commit c971034
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions utils/referance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ import (
)

func TestParseRef(t *testing.T) {
imageRef, err := ParseReference("arn:aws:ecr:us-west-2:foo:repository/bar:latest")
assert.NoError(t, err)
assert.Equal(t, "repository/bar:latest", imageRef.String())
t.Run("parses imgae ref with arn", func(t *testing.T) {
imageRef, err := ParseReference("arn:aws:ecr:us-west-2:foo:repository/bar:latest")
assert.NoError(t, err)
assert.Equal(t, "repository/bar:latest", imageRef.String())
})
t.Run("parses imgae ref without arn", func(t *testing.T) {
imageRef, err := ParseReference("k8s.gcr.io/etcd:3.4.13-0")
assert.NoError(t, err)
assert.Equal(t, "k8s.gcr.io/etcd:3.4.13-0", imageRef.String())
})
}

0 comments on commit c971034

Please sign in to comment.