summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authortheunrealgeek <theunrealgeek@gmail.com>2020-05-23 20:47:30 -0700
committertheunrealgeek <theunrealgeek@gmail.com>2020-06-02 20:33:16 -0700
commit478f296fb345ce9edc707aa4bcd588f8ffd55bb8 (patch)
tree5d05a272844010dca9b3f3acff6fc82528f1c349 /cmd
parentce7a9f03146da33007656ded64be3148d6ec8d77 (diff)
downloadpodman-478f296fb345ce9edc707aa4bcd588f8ffd55bb8.tar.gz
podman-478f296fb345ce9edc707aa4bcd588f8ffd55bb8.tar.bz2
podman-478f296fb345ce9edc707aa4bcd588f8ffd55bb8.zip
Modify PlayKubeReport to preserve pod->container mapping
Signed-off-by: Aditya Kamath <theunrealgeek@gmail.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/play/kube.go32
1 files changed, 17 insertions, 15 deletions
diff --git a/cmd/podman/play/kube.go b/cmd/podman/play/kube.go
index d2cfe8d43..17f3b430d 100644
--- a/cmd/podman/play/kube.go
+++ b/cmd/podman/play/kube.go
@@ -92,8 +92,10 @@ func kube(cmd *cobra.Command, args []string) error {
return err
}
- for _, l := range report.Logs {
- fmt.Fprintf(os.Stderr, l)
+ for _, pod := range report.Pods {
+ for _, l := range pod.Logs {
+ fmt.Fprintf(os.Stderr, l)
+ }
}
switch len(report.Pods) {
@@ -105,19 +107,19 @@ func kube(cmd *cobra.Command, args []string) error {
fmt.Printf("Pods:\n")
}
for _, pod := range report.Pods {
- fmt.Println(pod)
- }
-
- switch len(report.Containers) {
- case 0:
- return nil
- case 1:
- fmt.Printf("Container:\n")
- default:
- fmt.Printf("Containers:\n")
- }
- for _, ctr := range report.Containers {
- fmt.Println(ctr)
+ fmt.Println(pod.ID)
+
+ switch len(pod.Containers) {
+ case 0:
+ return nil
+ case 1:
+ fmt.Printf("Container:\n")
+ default:
+ fmt.Printf("Containers:\n")
+ }
+ for _, ctr := range pod.Containers {
+ fmt.Println(ctr)
+ }
}
return nil