You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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
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 registerazure-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.
spring-boot/spring-boot-project/spring-boot-testcontainers/src/main/java/org/springframework/boot/testcontainers/service/connection/ContainerConnectionSource.java
Line 88 in 1a2919b
If this is not expected then in order to fix it, should be replaced by
imageName.asCanonicalNameString()
.The text was updated successfully, but these errors were encountered: