mirror of
https://github.com/containrrr/watchtower.git
synced 2026-01-01 14:48:49 +01:00
unite trust.ParseServerAddress & helpers.NormalizeRegistry
This commit is contained in:
parent
f0e075c390
commit
85f5c1fdb1
8 changed files with 46 additions and 95 deletions
|
|
@ -41,17 +41,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