mirror of
https://github.com/crazy-max/diun.git
synced 2026-01-02 02:57:28 +01:00
Handle digest based image reference (#335)
Co-authored-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -6,12 +6,10 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/crazy-max/diun/v4/internal/model"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
// ValidateContainerImage returns a standard image through Docker labels
|
||||
func ValidateContainerImage(image string, labels map[string]string, watchByDef bool) (img model.Image, err error) {
|
||||
log.Debug().Msgf("Validating %s", image)
|
||||
// ValidateImage returns a standard image through Docker labels
|
||||
func ValidateImage(image string, labels map[string]string, watchByDef bool) (img model.Image, err error) {
|
||||
if i := strings.Index(image, "@sha256:"); i > 0 {
|
||||
image = image[:i]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user