-
Notifications
You must be signed in to change notification settings - Fork 91
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
Disable sync periodically polling when pollInterval is not configured #254
Conversation
@rchincha Regarding the third one, which is not yet included in this PR, returning UNAUTHORIZED to the client in case a sync on demand gets this error from an upstream registry. In routes, all the errors returned to the client, are registry specific errors, how can I customize the UNAUTHORIZED error so that I can tell the client which upstream registry throwed that error and that it is not returned by zot. Can I create a new error /pkg/api/errors.go ? |
Codecov Report
@@ Coverage Diff @@
## main #254 +/- ##
==========================================
+ Coverage 80.75% 80.83% +0.07%
==========================================
Files 46 46
Lines 6261 6265 +4
==========================================
+ Hits 5056 5064 +8
+ Misses 872 868 -4
Partials 333 333
Continue to review full report at Codecov.
|
Why not just wrap the error? |
Thinking about this some more, so if pollInterval is not specified and onDemand is false, then this registry is disabled for sync? |
Yes |
Ok, I wrap the error with the registry name, how can I return it to the client? eg:
Tried
But it doesn't get returned to client.... I don't understand why... |
I managed to send the error to the client, but if I set the http error code to 500 (InternalServerError) then my sync error doesn't get displayed.
500 case:
|
Thinking about this more, if you get Unauthorized from upstream, best to just log it as an error. For the downstream, the image will just not be available, so a NotFound will suffice. |
That's what I was thinking, it's more an administrator information than a client one. I already log it in sync. |
34fd288
to
7248600
Compare
Filtering out sync on demand images based on content configuration Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
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.
lgtm
Filtering out sync on demand images based on content configuration
Signed-off-by: Petu Eusebiu peusebiu@cisco.com