-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Extend AWS ECR regex for c2s support #20648
base: main
Are you sure you want to change the base?
Conversation
2c02cc3
to
06571b7
Compare
Hi @ethanchowell , Thanks for your contributions! Best, |
I'm not aware of any official docs, but can point to the ecr-credential-helper that implements this pattern successfully. Slightly modified of course to account for existing tests within the project. |
@ethanchowell Hi, thanks for your contribution, please resolve the DCO failure in CI. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #20648 +/- ##
===========================================
+ Coverage 45.36% 66.24% +20.87%
===========================================
Files 244 1045 +801
Lines 13333 113501 +100168
Branches 2719 2845 +126
===========================================
+ Hits 6049 75188 +69139
- Misses 6983 34202 +27219
- Partials 301 4111 +3810
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Signed-off-by: Ethan Howell <ethan.c.howell@hotmail.com>
Signed-off-by: Ethan Howell <ethan.c.howell@hotmail.com>
Signed-off-by: Ethan Howell <ethan.c.howell@hotmail.com>
Signed-off-by: Ethan Howell <ethan.c.howell@hotmail.com>
43f2ba5
to
3bebf57
Compare
@@ -67,7 +67,7 @@ func parseAccountRegion(url string) (string, string, error) { | |||
if rs == nil { | |||
return "", "", errors.New("bad aws url") | |||
} | |||
return rs[1], rs[2], nil | |||
return rs[1], rs[3], nil |
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.
Please add length check for rs before this line.
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.
Happy to add it, but shouldn't that always evaluate to true based on the docs for FindStringSubmatch? In the event of no match it would just be nil.
Thank you for contributing to Harbor!
Comprehensive Summary of your change
This PR extends the ecr regex check for c2s regions that don't follow the amazonaws domain convention.
Issue being fixed
Fixes #(issue)
Please indicate you've done the following: