mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-08 04:32:37 +00:00
Kubectl should be able to display endpoints directly and for service
kubectl get endpoints <servicename> kubectl describe service <servicename> should have printers for endpoints
This commit is contained in:
@@ -249,6 +249,11 @@ func (d *ServiceDescriber) Describe(namespace, name string) (string, error) {
|
||||
return "", err
|
||||
}
|
||||
|
||||
endpoints, err := d.Endpoints(namespace).Get(name)
|
||||
if err != nil {
|
||||
endpoints = &api.Endpoints{}
|
||||
}
|
||||
|
||||
events, _ := d.Events(namespace).Search(service)
|
||||
|
||||
return tabbedString(func(out io.Writer) error {
|
||||
@@ -256,6 +261,7 @@ func (d *ServiceDescriber) Describe(namespace, name string) (string, error) {
|
||||
fmt.Fprintf(out, "Labels:\t%s\n", formatLabels(service.Labels))
|
||||
fmt.Fprintf(out, "Selector:\t%s\n", formatLabels(service.Spec.Selector))
|
||||
fmt.Fprintf(out, "Port:\t%d\n", service.Spec.Port)
|
||||
fmt.Fprintf(out, "Endpoints:\t%s\n", stringList(endpoints.Endpoints))
|
||||
if events != nil {
|
||||
describeEvents(events, out)
|
||||
}
|
||||
|
Reference in New Issue
Block a user