Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show EgressCIDRs in "oc get hostsubnets" #20486

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/oc/lib/describe/describer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
})
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 @@ -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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pravisankar righto. fixed

}

Expand Down