mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-22 05:40:50 +02:00
fix(registry): image name parsing behavior (#1526)
Co-authored-by: nils måsén <nils@piksel.se>
This commit is contained in:
parent
aa50d12389
commit
25fdb40312
12 changed files with 249 additions and 294 deletions
|
@ -43,17 +43,17 @@ func DefaultAuthHandler() (string, error) {
|
|||
// Will return false if behavior for container is unknown.
|
||||
func WarnOnAPIConsumption(container watchtowerTypes.Container) bool {
|
||||
|
||||
normalizedName, err := ref.ParseNormalizedNamed(container.ImageName())
|
||||
normalizedRef, err := ref.ParseNormalizedNamed(container.ImageName())
|
||||
if err != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
containerHost, err := helpers.NormalizeRegistry(normalizedName.String())
|
||||
containerHost, err := helpers.GetRegistryAddress(normalizedRef.Name())
|
||||
if err != nil {
|
||||
return true
|
||||
}
|
||||
|
||||
if containerHost == "index.docker.io" || containerHost == "ghcr.io" {
|
||||
if containerHost == helpers.DefaultRegistryHost || containerHost == "ghcr.io" {
|
||||
return true
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue