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

Document more precisely how a Container's Docker image name is used to find the matching service connection #41111

Closed
eddumelendez opened this issue Jun 15, 2024 · 1 comment
Assignees
Labels
type: documentation A documentation update
Milestone

Comments

@eddumelendez
Copy link
Contributor

I was working on Azure/azure-sdk-for-java#40388 when I noticed the following, azurite full image is mcr.microsoft.com/azure-storage/azurite:latest, however I should register azure-storage/azurite as connection name, see the implementation in order to make it work.

Looking at the code, I found that the connection name only considers the repository from the full image (as you can see in the link below), ignoring the registry. Meanwhile implementing Service Connections I thought the connection name is always the image name, which in most cases only considers the repository. When I was working on the PR mentioned at the beginning I used the full image (registry + repository) as connection name and it was not working.

If this is not expected then in order to fix it, should be replaced by imageName.asCanonicalNameString().

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 15, 2024
@wilkinsona
Copy link
Member

I don't think we should consider the name of the registry. It would complicate things when someone's using a mirror where the repository portion of the name is unchanged as it would make it less likely that things would match without using the name attribute of @ServiceConnection.

The documentation currently states that:

by default Container.getDockerImageName() is used to obtain the name used to find connection details.

This is ambiguous as we don't describe how the Docker image name is used. We should improve that to describe that it's only the repository that's used, i.e. neither the registry nor the version is considered.

@wilkinsona wilkinsona changed the title ServiceConnection's connection name doesn't consider image registry Document more precisely how a Container's Docker image name is used to find the matching service connection Jun 16, 2024
@wilkinsona wilkinsona added type: documentation A documentation update and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 16, 2024
@wilkinsona wilkinsona added this to the 3.2.x milestone Jun 16, 2024
@wilkinsona wilkinsona self-assigned this Jun 17, 2024
@wilkinsona wilkinsona modified the milestones: 3.2.x, 3.2.7 Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: documentation A documentation update
Projects
None yet
Development

No branches or pull requests

3 participants