Skip to content
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

fix(sync): added bearer client for sync #2222

Merged

Conversation

eusebiu-constantin-petu-dbk
Copy link
Collaborator

@eusebiu-constantin-petu-dbk eusebiu-constantin-petu-dbk commented Feb 1, 2024

fixed ping function taking too much time

closes: #2213 #2212

What type of PR is this?
bug

Which issue does this PR fix:
Fixes the sync taking too much time to fallback to serving local cached image, in case the remote is unavailable.
Added bearer auth for http client.
Should also fix multiple unauthorized messages we saw in sync logs when trying to sync referrers.

This is WIP

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Copy link

codecov bot commented Feb 1, 2024

Codecov Report

Attention: 43 lines in your changes are missing coverage. Please review.

Comparison is base (36e04a4) 92.89% compared to head (f4352b9) 92.79%.

Files Patch % Lines
pkg/extensions/sync/httpclient/client.go 81.00% 23 Missing and 11 partials ⚠️
pkg/extensions/sync/remote.go 66.66% 2 Missing and 2 partials ⚠️
pkg/extensions/sync/httpclient/cache.go 92.00% 1 Missing and 1 partial ⚠️
pkg/extensions/sync/sync.go 0.00% 1 Missing and 1 partial ⚠️
pkg/extensions/sync/on_demand.go 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2222      +/-   ##
==========================================
- Coverage   92.89%   92.79%   -0.10%     
==========================================
  Files         165      166       +1     
  Lines       21582    21760     +178     
==========================================
+ Hits        20048    20192     +144     
- Misses        956      980      +24     
- Partials      578      588      +10     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pkg/common/common.go Outdated Show resolved Hide resolved
@eusebiu-constantin-petu-dbk eusebiu-constantin-petu-dbk force-pushed the fix_sync_issues branch 2 times, most recently from 94f6d12 to 11a34e5 Compare February 2, 2024 14:50
@eusebiu-constantin-petu-dbk eusebiu-constantin-petu-dbk force-pushed the fix_sync_issues branch 2 times, most recently from ba08f4d to 24f9536 Compare February 5, 2024 17:13
pkg/common/http_client_test.go Outdated Show resolved Hide resolved
pkg/extensions/sync/httpclient/client.go Outdated Show resolved Hide resolved
@rchincha rchincha added this to the v2.0.2 milestone Feb 5, 2024
@eusebiu-constantin-petu-dbk eusebiu-constantin-petu-dbk force-pushed the fix_sync_issues branch 8 times, most recently from 9d8e00d to a16ecab Compare February 9, 2024 15:59
fixed ping function taking too much time

closes: project-zot#2213 project-zot#2212

Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
@eusebiu-constantin-petu-dbk
Copy link
Collaborator Author

@piontec

This should solve two of your issues, one is periodically sync now should work with your azure instance.
The ping which hanged for minutes should also be solved.

Can you test it on your side please?

Copy link
Contributor

@rchincha rchincha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@rchincha rchincha merged commit 8e68255 into project-zot:main Feb 14, 2024
32 of 34 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants