mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 15:58:37 +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
|
||||
}
|
||||
|
||||
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 serviceColumns = []string{"NAME", "LABELS", "SELECTOR", "IP", "PORT"}
|
||||
var minionColumns = []string{"NAME", "LABELS"}
|
||||
@ -267,7 +267,7 @@ func printPod(pod *api.Pod, w io.Writer) error {
|
||||
if len(containers) > 0 {
|
||||
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.Status.PodIP,
|
||||
firstContainer.Name,
|
||||
@ -280,7 +280,7 @@ func printPod(pod *api.Pod, w io.Writer) error {
|
||||
}
|
||||
// Lay out all the other containers on separate lines.
|
||||
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 {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user