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: pass through the headers specified by user to preheat job #3257

Merged
merged 1 commit into from May 13, 2024

Conversation

chlins
Copy link
Contributor

@chlins chlins commented May 11, 2024

Description

Background:
Harbor utilizes the V1 preheat job, which includes the auth token issued by Harbor in the request body. However, Dragonfly 2.x's auth logic relies on the username and password to exchange tokens, following the v2 auth flow. As a result, when Harbor attempts to preheat to Dragonfly 2.x, it encounters a 401 unauthorized error as Dragonfly tries to pull the manifest from the private project. To maintain backward compatibility, the auth logic should be aligned to be compatible with 1.x.

Related Issue

Motivation and Context

Screenshots (if appropriate)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@chlins chlins requested a review from a team as a code owner May 11, 2024 08:13
@chlins chlins force-pushed the fix/preheat-headers branch 2 times, most recently from 1955730 to eb2fff0 Compare May 11, 2024 08:16
Copy link

codecov bot commented May 11, 2024

Codecov Report

Attention: Patch coverage is 18.75000% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 52.74%. Comparing base (c40cba5) to head (d91b310).
Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3257      +/-   ##
==========================================
- Coverage   52.84%   52.74%   -0.10%     
==========================================
  Files         192      192              
  Lines       20355    20372      +17     
==========================================
- Hits        10756    10746      -10     
- Misses       8798     8819      +21     
- Partials      801      807       +6     
Flag Coverage Δ
unittests 52.74% <18.75%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
manager/job/preheat.go 52.19% <18.75%> (-3.77%) ⬇️

... and 4 files with indirect coverage changes

@gaius-qi
Copy link
Member

@chlins Please fix CI.

Background:
  Harbor utilizes the V1 preheat job, which includes the auth token issued by Harbor in the request body. However, Dragonfly 2.x's auth logic relies on the username and password to exchange tokens, following the v2 auth flow. As a result, when Harbor attempts to preheat to Dragonfly 2.x, it encounters a 401 unauthorized error as Dragonfly tries to pull the manifest from the private project. To maintain backward compatibility, the auth logic should be aligned to be compatible with 1.x.

Signed-off-by: chlins <chenyuzh@vmware.com>
Copy link
Member

@gaius-qi gaius-qi left a comment

Choose a reason for hiding this comment

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

LGTM

@gaius-qi gaius-qi merged commit b675f41 into dragonflyoss:main May 13, 2024
27 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
Development

Successfully merging this pull request may close these issues.

None yet

2 participants