Skip to content

Commit

Permalink
Merge pull request #20486 from danwinship/oc-get-hostsubnet
Browse files Browse the repository at this point in the history
Show EgressCIDRs in "oc get hostsubnets"
  • Loading branch information
openshift-merge-robot authored Aug 28, 2018
2 parents 3c0a433 + cd93d29 commit c7f1709
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions pkg/oc/lib/describe/describer.go
Original file line number Diff line number Diff line change
Expand Up @@ -1780,6 +1780,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
})
Expand Down
4 changes: 2 additions & 2 deletions pkg/printers/internalversion/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"}
Expand Down Expand Up @@ -1000,7 +1000,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
}

Expand Down

0 comments on commit c7f1709

Please sign in to comment.