From cd93d29c681884915d407b528f363ec5048eee2a Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Tue, 31 Jul 2018 10:11:05 -0400 Subject: [PATCH] Add HostSubnet.EgressCIDRs support to "oc get" and "oc describe" --- pkg/oc/lib/describe/describer.go | 1 + pkg/printers/internalversion/printer.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/oc/lib/describe/describer.go b/pkg/oc/lib/describe/describer.go index a33b05df4761..f7919ef72900 100644 --- a/pkg/oc/lib/describe/describer.go +++ b/pkg/oc/lib/describe/describer.go @@ -1752,6 +1752,7 @@ func (d *HostSubnetDescriber) Describe(namespace, name string, settings kprinter formatString(out, "Node", hs.Host) formatString(out, "Node IP", hs.HostIP) formatString(out, "Pod Subnet", hs.Subnet) + formatString(out, "Egress CIDRs", strings.Join(hs.EgressCIDRs, ", ")) formatString(out, "Egress IPs", strings.Join(hs.EgressIPs, ", ")) return nil }) diff --git a/pkg/printers/internalversion/printer.go b/pkg/printers/internalversion/printer.go index 8933fc81f938..2423ce2110f3 100644 --- a/pkg/printers/internalversion/printer.go +++ b/pkg/printers/internalversion/printer.go @@ -63,7 +63,7 @@ var ( // IsPersonalSubjectAccessReviewColumns contains known custom role extensions IsPersonalSubjectAccessReviewColumns = []string{"NAME"} - hostSubnetColumns = []string{"NAME", "HOST", "HOST IP", "SUBNET", "EGRESS IPS"} + hostSubnetColumns = []string{"NAME", "HOST", "HOST IP", "SUBNET", "EGRESS CIDRS", "EGRESS IPS"} netNamespaceColumns = []string{"NAME", "NETID", "EGRESS IPS"} clusterNetworkColumns = []string{"NAME", "CLUSTER NETWORKS", "SERVICE NETWORK", "PLUGIN NAME"} egressNetworkPolicyColumns = []string{"NAME"} @@ -987,7 +987,7 @@ func printGroupList(list *userapi.GroupList, w io.Writer, opts kprinters.PrintOp func printHostSubnet(h *networkapi.HostSubnet, w io.Writer, opts kprinters.PrintOptions) error { name := formatResourceName(opts.Kind, h.Name, opts.WithKind) - _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t[%s]\n", name, h.Host, h.HostIP, h.Subnet, strings.Join(h.EgressIPs, ", ")) + _, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t[%s]\t[%s]\n", name, h.Host, h.HostIP, h.Subnet, strings.Join(h.EgressCIDRs, ", "), strings.Join(h.EgressIPs, ", ")) return err }