mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
Separate colume for PodIP from kubectl get pods
This commit is contained in:
parent
39c917b068
commit
7b457fd33f
@ -215,7 +215,7 @@ func (h *HumanReadablePrinter) validatePrintHandlerFunc(printFunc reflect.Value)
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
var podColumns = []string{"POD", "CONTAINER(S)", "IMAGE(S)", "HOST", "LABELS", "STATUS"}
|
var podColumns = []string{"POD", "IP", "CONTAINER(S)", "IMAGE(S)", "HOST", "LABELS", "STATUS"}
|
||||||
var replicationControllerColumns = []string{"CONTROLLER", "CONTAINER(S)", "IMAGE(S)", "SELECTOR", "REPLICAS"}
|
var replicationControllerColumns = []string{"CONTROLLER", "CONTAINER(S)", "IMAGE(S)", "SELECTOR", "REPLICAS"}
|
||||||
var serviceColumns = []string{"NAME", "LABELS", "SELECTOR", "IP", "PORT"}
|
var serviceColumns = []string{"NAME", "LABELS", "SELECTOR", "IP", "PORT"}
|
||||||
var minionColumns = []string{"NAME", "LABELS"}
|
var minionColumns = []string{"NAME", "LABELS"}
|
||||||
@ -267,7 +267,7 @@ func printPod(pod *api.Pod, w io.Writer) error {
|
|||||||
if len(containers) > 0 {
|
if len(containers) > 0 {
|
||||||
firstContainer, containers = containers[0], containers[1:]
|
firstContainer, containers = containers[0], containers[1:]
|
||||||
}
|
}
|
||||||
_, err := fmt.Fprintf(w, "%s/%s\t%s\t%s\t%s\t%s\t%s\n",
|
_, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\n",
|
||||||
pod.Name,
|
pod.Name,
|
||||||
pod.Status.PodIP,
|
pod.Status.PodIP,
|
||||||
firstContainer.Name,
|
firstContainer.Name,
|
||||||
@ -280,7 +280,7 @@ func printPod(pod *api.Pod, w io.Writer) error {
|
|||||||
}
|
}
|
||||||
// Lay out all the other containers on separate lines.
|
// Lay out all the other containers on separate lines.
|
||||||
for _, container := range containers {
|
for _, container := range containers {
|
||||||
_, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\n", "", container.Name, container.Image, "", "", "")
|
_, err := fmt.Fprintf(w, "%s\t%s\t%s\t%s\t%s\t%s\t%s\n", "", "", container.Name, container.Image, "", "", "")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user