Skip to content

Commit c7f1709

Browse files
Merge pull request #20486 from danwinship/oc-get-hostsubnet
Show EgressCIDRs in "oc get hostsubnets"
2 parents 3c0a433 + cd93d29 commit c7f1709

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pkg/oc/lib/describe/describer.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,6 +1780,7 @@ func (d *HostSubnetDescriber) Describe(namespace, name string, settings kprinter
17801780
formatString(out, "Node", hs.Host)
17811781
formatString(out, "Node IP", hs.HostIP)
17821782
formatString(out, "Pod Subnet", hs.Subnet)
1783+
formatString(out, "Egress CIDRs", strings.Join(hs.EgressCIDRs, ", "))
17831784
formatString(out, "Egress IPs", strings.Join(hs.EgressIPs, ", "))
17841785
return nil
17851786
})

pkg/printers/internalversion/printer.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ var (
6363
// IsPersonalSubjectAccessReviewColumns contains known custom role extensions
6464
IsPersonalSubjectAccessReviewColumns = []string{"NAME"}
6565

66-
hostSubnetColumns = []string{"NAME", "HOST", "HOST IP", "SUBNET", "EGRESS IPS"}
66+
hostSubnetColumns = []string{"NAME", "HOST", "HOST IP", "SUBNET", "EGRESS CIDRS", "EGRESS IPS"}
6767
netNamespaceColumns = []string{"NAME", "NETID", "EGRESS IPS"}
6868
clusterNetworkColumns = []string{"NAME", "CLUSTER NETWORKS", "SERVICE NETWORK", "PLUGIN NAME"}
6969
egressNetworkPolicyColumns = []string{"NAME"}
@@ -1000,7 +1000,7 @@ func printGroupList(list *userapi.GroupList, w io.Writer, opts kprinters.PrintOp
10001000

10011001
func printHostSubnet(h *networkapi.HostSubnet, w io.Writer, opts kprinters.PrintOptions) error {
10021002
name := formatResourceName(opts.Kind, h.Name, opts.WithKind)
1003-
_, 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, ", "))
1003+
_, 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, ", "))
10041004
return err
10051005
}
10061006

0 commit comments

Comments
 (0)