mirror of
https://github.com/containrrr/watchtower.git
synced 2025-09-21 21:30:48 +02:00
Log based on registry known-support - reduce noise on notifications (#716)
Log based on registry known-poor support of HEAD in checking container manifest. Some private registries do not support HEAD (E.G. GitLab Container Registry). With the current config, this log message is causing a notification to be sent for each container hosted in a registry lacking HEAD support. log.Debug or log.Warning for failed HTTP HEAD-check based on registry hostname where HEAD-check is known to fail. For Docker Hub, a failed HEAD leading to a "regular pull" may count against a user's call-quota whereas other registry implementations do not support HEAD, or whose container manifest may be in a different location.
This commit is contained in:
parent
8b81fbd48d
commit
5983d58d7c
2 changed files with 31 additions and 1 deletions
|
@ -295,7 +295,11 @@ func (client dockerClient) PullImage(ctx context.Context, container Container) e
|
|||
log.WithFields(fields).Debugf("Checking if pull is needed")
|
||||
|
||||
if match, err := digest.CompareDigest(container, opts.RegistryAuth); err != nil {
|
||||
log.Info("Could not do a head request, falling back to regular pull.")
|
||||
if registry.WarnOnAPIConsumption(container) {
|
||||
log.WithFields(fields).Warning("Could not do a head request, falling back to regular pull.")
|
||||
} else {
|
||||
log.Debug("Could not do a head request, falling back to regular pull.")
|
||||
}
|
||||
log.Debugf("Reason: %s", err.Error())
|
||||
} else if match {
|
||||
log.Debug("No pull needed. Skipping image.")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue