Skip to content

Commit

Permalink
added missing hostport column to ports command
Browse files Browse the repository at this point in the history
  • Loading branch information
NimbleArchitect committed Mar 3, 2022
1 parent 9d863ff commit 58d6fa1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/plugin/ports.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,17 @@ func Ports(cmd *cobra.Command, kubeFlags *genericclioptions.ConfigFlags, args []
}

func portsBuildRow(container v1.Container, port v1.ContainerPort, containerType string) []string {
hostPort := ""

if port.HostPort > 0 {
hostPort = fmt.Sprintf("%d", port.HostPort)
}
return []string{
containerType,
container.Name,
port.Name,
fmt.Sprintf("%d", port.ContainerPort),
string(port.Protocol),
hostPort,
}
}

0 comments on commit 58d6fa1

Please sign in to comment.