-
Notifications
You must be signed in to change notification settings - Fork 854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log based on registry known-support - reduce noise on notifications #716
Log based on registry known-support - reduce noise on notifications #716
Conversation
In my case, I'm getting 48 noop notifications per hour:
I'm hoping this is in time for the next tagged release -- and that it's soon. |
Hi, Thank you for your contribution! We'll definitely consider this in case we're unable to get HEAD to work consistently. However, I'd like to wait for In the best of worlds, we'll be able to keep logs of failing head requests as a warning for when DockerHub users are consuming their rate limit - without spamming you in the progress. If it's still too noisy post that, and we come to the conclusion that we're out of options, we'll make a fast patch release with your changes. Best, |
Hey @simskij, thanks for the consideration. Totally agree with the need for visibility when it comes to Docker Hub API consumption -- and I half-agree with the idea of checking HEAD only on dockerhub. I'll bring it up in issue 715 too, but one idea might be keep the check for all containers/registries but selectively |
33fb59e
to
3f762c1
Compare
Updated with one possible way. Golang isn't my one of my primary languages, so I'm not going to feel bad at all if this isn't up to y'alls standards or deviates too far from the established patterns. I managed to confirm it works by dint of live testing. Here are the relevant log files with some light redaction:
The error on the 'full-pull' for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! Some minor nitpicks, but other than that I think we're ready to roll 👍 🎉 Thanks for helping out! 🙏
@simskij Based on the comments in Issue 715, it seems as though GitLab Registry are the only ones still suffering heartburn. It appears they have a URL pathname pattern for the manifests that's different from DockerHub, GitHub, GCR, and others. Any objection to flipping the logic so it Strange thing is that GitLab Registry does respond appropriately to the command |
f681b31
to
bd3db60
Compare
I think the previous approach with only making them info-level for DockerHub probably will work better, as that's the only case (right now) where it actually makes any real difference for the user. In the other cases, if it works then good, otherwise no harm, right? My thinking is that we already know of two or three cases where it won't work, GitLab, GitHub Packages, and some local registries. For local registries, I assume the varying success rate mostly has to do with versions and such as it works for me with |
Totally reasonable to me. 💯 agree: local, private-network registries will be hard to enumerate and probably shouldn't be notifying anyway. Will revert and push in just a moment -- |
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.
bd3db60
to
cf11156
Compare
Awesome! Thanks a bunch for your help with this! |
@all-contributors add @tkalus for code |
I've put up a pull request to add @tkalus! 🎉 |
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.
Attempt to
log.Debug
orlog.Warning
for failed HTTP HEAD-check based onregistry hostname. For Docker Hub, a failed HEAD may count against a
user's call-quota whereas other registry implementations do not support HEAD.
Fixes #715