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

Improve Dev Services network output in dev mode when typing c #45008

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public String formatPorts() {
return Arrays.stream(getExposedPorts())
.filter(p -> p.getPublicPort() != null)
.map(c -> c.getIp() + ":" + c.getPublicPort() + "->" + c.getPrivatePort() + "/" + c.getType())
.collect(Collectors.joining(" ,"));
.collect(Collectors.joining(", "));
}

public static class ContainerPort {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ private static String[] getNetworks(Container container) {
return networks.entrySet().stream()
.map(e -> {
List<String> aliases = e.getValue().getAliases();
if (aliases == null) {
if (aliases == null || aliases.isEmpty()) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just for safety as the contract might change given it's considered bad practice to return a null list.

return e.getKey();
}
return e.getKey() + " (" + String.join(",", aliases) + ")";
return e.getKey() + " (" + String.join(", ", aliases) + ")";
})
.toArray(String[]::new);
}
Expand Down
Loading