testcontainers / testcontainers/testcontainers-java
Late ContainerFetchException on wrong image name
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 8.7k
- Forks
- 1.9k
- Avg merge
- 2d 17h
- Merged PRs (30d)
- 9
Description
I composed a, at least for me, invalid image name neo4j:neo4j:4.4 and threw it into TC.
Obviously, the image could not be found and the error contained:
RemoteDockerImage(imageName=neo4j:neo4j, imagePullPolicy=DefaultPullPolicy())
Somewhere between the creation of the DockerImageName and the output of RemoteDockerImage's toString()(?) the last bit got missed. I assume it's this part:
https://github.com/testcontainers/testcontainers-java/blob/0408db806f6d57b8117881adcd10b6bd6c9dcd9c/core/src/main/java/org/testcontainers/utility/DockerImageName.java#L74-L77
Would be helpful if the parsing in DockerImageName would be even more restrictive, if the name has an invalid pattern. (At least, I assume that this pattern is non-sense 😉 )
Somehow related to #4762
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in core/src/main/java/org/testcontainers/utility/DockerImageName.java at lines 74-77, then reproduce the invalid neo4j:neo4j:4.4 image name and trace how it appears in RemoteDockerImage. Check how the parsed name is rendered and define completion as malformed image names being rejected without losing the final tag in the error output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, java
- Domain
- testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100