Skip to content

Commit 8a0acaa

Browse files
authored
Merge pull request moby#24699 from dnephin/fixes_to_service_inspect
Only show port name if set
2 parents 80965a3 + 909c596 commit 8a0acaa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/client/service/inspect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ func printService(out io.Writer, service swarm.Service) {
141141
if len(service.Endpoint.Ports) > 0 {
142142
fmt.Fprintln(out, "Ports:")
143143
for _, port := range service.Endpoint.Ports {
144-
fmt.Fprintf(out, " Name = %s\n", port.Name)
144+
ioutils.FprintfIfNotEmpty(out, " Name = %s\n", port.Name)
145145
fmt.Fprintf(out, " Protocol = %s\n", port.Protocol)
146146
fmt.Fprintf(out, " TargetPort = %d\n", port.TargetPort)
147147
fmt.Fprintf(out, " PublishedPort = %d\n", port.PublishedPort)

0 commit comments

Comments
 (0)