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(localstack): more reliable legacy tag detection #2936

Merged
merged 2 commits into from
Jan 14, 2025

Conversation

NathanBaulch
Copy link
Contributor

What does this PR do?

Improves the internal isLegacyMode function to handle all tag conventions used by localstack.

Why is it important?

I'm currently unable to use the much smaller localstack/localstack:s3-latest image tag because it's incorrectly detected as a legacy version.

How to test this PR

Unit test included.

@NathanBaulch NathanBaulch requested a review from a team as a code owner January 10, 2025 11:27
Copy link

netlify bot commented Jan 10, 2025

Deploy Preview for testcontainers-go ready!

Name Link
🔨 Latest commit 2f87127
🔍 Latest deploy log https://app.netlify.com/sites/testcontainers-go/deploys/678622f7010d2f0008913810
😎 Deploy Preview https://deploy-preview-2936--testcontainers-go.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@NathanBaulch NathanBaulch force-pushed the fix-localstack-legacy branch from 4d651db to c8dd734 Compare January 10, 2025 11:28
@NathanBaulch NathanBaulch changed the title fix(localstack): More reliable legacy tag detection fix(localstack): more reliable legacy tag detection Jan 10, 2025
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, added a comment regarding the non-legacy tags

modules/localstack/localstack.go Outdated Show resolved Hide resolved
@NathanBaulch
Copy link
Contributor Author

NathanBaulch commented Jan 10, 2025

I just noticed the isVersion2 function which has similar issues.

@NathanBaulch NathanBaulch force-pushed the fix-localstack-legacy branch from 299ea0c to c8dd734 Compare January 10, 2025 12:18
@NathanBaulch NathanBaulch force-pushed the fix-localstack-legacy branch from c8dd734 to 09e009d Compare January 10, 2025 22:01
@mdelapenya mdelapenya self-assigned this Jan 13, 2025
@mdelapenya mdelapenya added the bug An issue with the library label Jan 13, 2025
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

@stevenh anything to highlight here? This LGTM, thanks!

mdelapenya
mdelapenya previously approved these changes Jan 14, 2025
Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Question (not a blocker at all): do you see we can take the chance to refactor both functions, isLegacyMode and isVersion2 as the code in there is practically the same? I'm approving the PR anyway, so will merge it if you don't consider it for this PR and prefer doing it in a follow-up.

Thanks again for your time 🙇

@NathanBaulch
Copy link
Contributor Author

do you see we can take the chance to refactor both functions, isLegacyMode and isVersion2 as the code in there is practically the same?

Definitely. I thought about doing this but didn't want to mess with the code too much as a new contributor. See my latest change.

Copy link
Member

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the refactor!

@mdelapenya mdelapenya merged commit 83d5e55 into testcontainers:main Jan 14, 2025
124 checks passed
@NathanBaulch NathanBaulch deleted the fix-localstack-legacy branch January 14, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue with the library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants