-
Notifications
You must be signed in to change notification settings - Fork 10
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
Allow configuring the network name for project-based containers #561
Conversation
Generate changelog in
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the goal is just to have a valid network name, can we just remove invalid characters instead?
docker-proxy-junit-jupiter/src/main/java/com/palantir/docker/proxy/DockerProxyExtension.java
Outdated
Show resolved
Hide resolved
I was hesitant to break back-compat if any client currently asserts that the network looks like they expect. |
@@ -66,7 +66,24 @@ public static DockerProxyExtension fromProjectName(ProjectName projectName, Clas | |||
public static DockerProxyExtension fromProjectName( | |||
ProjectName projectName, Class<?> classToLogFor, String imageNameOverride) { | |||
return new DockerProxyExtension( | |||
docker -> new ProjectBasedDockerContainerInfo(docker, projectName, Optional.of(imageNameOverride)), | |||
docker -> new ProjectBasedDockerContainerInfo( | |||
docker, projectName, Optional.empty(), Optional.of(imageNameOverride)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These parameters are the wrong way around I think
DockerExecutable docker, | ||
ProjectName projectName, | ||
Optional<String> networkNameOverride, | ||
Optional<String> imageNameOverride) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we also do the same here to keep the constructors consistent
Released 1.9.0 |
For context, a reverse DNS lookup returns the container name with the network name at the end. This is invalid when it contains an underscore |
Before this PR
The default network name generated includes an underscore, which is not always valid.
After this PR
==COMMIT_MSG==
Projects using DockerProxyExtension for project-based containers can now override the docker network name used by the proxy
==COMMIT_MSG==
Possible downsides?