-
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
b788c92
Allow configuring the network name for project-based containers
mswintermeyer 98d5914
errorprone
mswintermeyer 4058822
Add generated changelog entries
svc-changelog 2701e2d
change param order
mswintermeyer 1a8bdd8
Change default to hyphen
mswintermeyer 03455d1
change it in tests too
mswintermeyer 47d133e
back to original default
mswintermeyer 2dc3580
Revert "back to original default"
mswintermeyer 35f2a59
Change tests to set default with hyphen
mswintermeyer 86a70fc
Revert "Change tests to set default with hyphen"
mswintermeyer 823e0ff
Revert "Revert "back to original default""
mswintermeyer 2a57439
image name before network name everywhere
mswintermeyer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type: feature | ||
feature: | ||
description: Projects using DockerProxyExtension for project-based containers can | ||
now override the docker network name used by the proxy | ||
links: | ||
- https://github.com/palantir/docker-proxy-rule/pull/561 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,17 +24,22 @@ | |
public final class ProjectBasedDockerContainerInfo implements DockerContainerInfo { | ||
private final DockerExecutable docker; | ||
private final ProjectName projectName; | ||
private final Optional<String> networkNameOverride; | ||
private final Optional<String> imageNameOverride; | ||
|
||
public ProjectBasedDockerContainerInfo( | ||
DockerExecutable docker, ProjectName projectName, Optional<String> imageNameOverride) { | ||
DockerExecutable docker, | ||
ProjectName projectName, | ||
Optional<String> networkNameOverride, | ||
Optional<String> imageNameOverride) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we also do the same here to keep the constructors consistent |
||
this.docker = docker; | ||
this.projectName = projectName; | ||
this.networkNameOverride = networkNameOverride; | ||
this.imageNameOverride = imageNameOverride; | ||
} | ||
|
||
public ProjectBasedDockerContainerInfo(DockerExecutable docker, ProjectName projectName) { | ||
this(docker, projectName, Optional.empty()); | ||
this(docker, projectName, Optional.empty(), Optional.empty()); | ||
} | ||
|
||
@Override | ||
|
@@ -62,7 +67,7 @@ public Optional<String> getHostForIp(String ip) { | |
|
||
@Override | ||
public String getNetworkName() { | ||
return projectName.asString() + "_default"; | ||
return networkNameOverride.orElseGet(() -> projectName.asString() + "_default"); | ||
} | ||
|
||
@Override | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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