Skip to content

Commit

Permalink
don't strip digest from image name
Browse files Browse the repository at this point in the history
  • Loading branch information
crazy-max committed Sep 16, 2023
1 parent 061c976 commit 4a81b2b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 0 additions & 4 deletions internal/provider/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@ var (

// ValidateImage returns a standard image through Docker labels
func ValidateImage(image string, metadata, labels map[string]string, watchByDef bool, imageDefaults model.Image) (img model.Image, err error) {
if i := strings.Index(image, "@sha256:"); i > 0 {
image = image[:i]
}

img = model.Image{
Name: image,
}
Expand Down
4 changes: 2 additions & 2 deletions internal/provider/common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ func TestValidateImage(t *testing.T) {
expectedErr interface{}
}{
{
name: "Test strip digest",
name: "Test with digest",
image: "myimg@sha256:1234567890abcdef",
watchByDef: true,
expectedImage: model.Image{
Name: "myimg",
Name: "myimg@sha256:1234567890abcdef",
},
expectedErr: nil,
},
Expand Down

0 comments on commit 4a81b2b

Please sign in to comment.