Skip to content
This repository was archived by the owner on Dec 20, 2025. It is now read-only.

Conversation

@kirangodishala
Copy link
Contributor

Addresses the issue - spinnaker/spinnaker#7015 (comment)

AWS ECR's response header link contains encrypted and encoded url which often has special characters like %2F(/ before encoding), %3D(= before encoding) etc. But retrofit2 doesn't allow % in the url without encoding it. As a result %2F becomes %252F and %3D becomes %253D as %25 is the encoded representation of % and causing server side error -

com.netflix.spinnaker.kork.retrofit.exceptions.SpinnakerHttpException: 
Status: 405, Method: GET, 
URL: https://<ACCOUNT_ID>.dkr.ecr.<REGION>.amazonaws.com/v2/<REPOSITORY_NAME>/tags/list?last=...%252F...%252B...%252F...%252F...%252F...%252B...%252B...%252B...%253D, 
Message: Method Not Allowed

This PR addresses the issue by preventing double encoding by retrofit2 client.

Since the QueryMap was introduced earlier, the very first call to tags list api needs to be passed the original paginate size in the query param. This is addressed in this PR as well.

@kirangodishala kirangodishala force-pushed the fix-double-encoding-issue branch from a914781 to f787ce1 Compare March 12, 2025 17:59
… query parameter when the next link from a docker registry like ECR responds with an encoded url.
…R's next `link` header causing the Retrofit2 client to fail due to error code `405` and `Message: Method Not Allowed`.
@kirangodishala kirangodishala force-pushed the fix-double-encoding-issue branch from f787ce1 to 3de40a9 Compare March 12, 2025 18:27
@dbyron-sf dbyron-sf added the ready to merge Approved and ready for a merge label Mar 12, 2025
@mergify mergify bot added the auto merged Merged automatically by a bot label Mar 12, 2025
@mergify mergify bot merged commit 06c98c0 into spinnaker:master Mar 12, 2025
24 checks passed
@dbyron-sf
Copy link
Contributor

@Mergifyio backport release-1.37.x

@mergify
Copy link
Contributor

mergify bot commented Mar 12, 2025

backport release-1.37.x

✅ Backports have been created

Details

mergify bot pushed a commit that referenced this pull request Mar 12, 2025
…xt call to ECR's tags list (#6357)

* test(docker): add test to demonstrate the issue of double encoding of query parameter when the next link from a docker registry like ECR responds with an encoded url.

* fix(docker): resolve the issue of double encoding contained in the ECR's next `link` header causing the Retrofit2 client to fail due to error code `405` and `Message: Method Not Allowed`.

(cherry picked from commit 06c98c0)
mergify bot added a commit that referenced this pull request Mar 12, 2025
…xt call to ECR's tags list (#6357) (#6358)

* test(docker): add test to demonstrate the issue of double encoding of query parameter when the next link from a docker registry like ECR responds with an encoded url.

* fix(docker): resolve the issue of double encoding contained in the ECR's next `link` header causing the Retrofit2 client to fail due to error code `405` and `Message: Method Not Allowed`.

(cherry picked from commit 06c98c0)

Co-authored-by: Kiran Godishala <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

auto merged Merged automatically by a bot ready to merge Approved and ready for a merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants