From 3e389566bfc345737f0266a58700c5fd79aa3824 Mon Sep 17 00:00:00 2001 From: xiangpengzhao Date: Mon, 8 May 2017 16:08:49 +0800 Subject: [PATCH] Display when port is empty. --- pkg/printers/internalversion/describe.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/printers/internalversion/describe.go b/pkg/printers/internalversion/describe.go index 64dc9b13d66..2a648d368e6 100644 --- a/pkg/printers/internalversion/describe.go +++ b/pkg/printers/internalversion/describe.go @@ -1073,7 +1073,11 @@ func describeContainerBasicInfo(container api.Container, status api.ContainerSta if strings.Contains(portString, ",") { w.Write(LEVEL_2, "Ports:\t%s\n", portString) } else { - w.Write(LEVEL_2, "Port:\t%s\n", portString) + if len(portString) == 0 { + w.Write(LEVEL_2, "Port:\t\n") + } else { + w.Write(LEVEL_2, "Port:\t%s\n", portString) + } } }