fix bug --format {{json.}} of events

Allow the `podman events --format` accept {{json.}} and complete small fix podman-events.1.md

Signed-off-by: Qi Wang <qiwan@redhat.com>
This commit is contained in:
Qi Wang committed 2020-05-14 14:28:51 -04:00
1 parent 7e9ed37c09
commit 28ffe74e44
3 files changed
+19 -1

No files matched your search

+14
View File
@@ -137,5 +137,19 @@ var _ = Describe("Podman events", func() {
_, exist := eventsMap["Status"]
Expect(exist).To(BeTrue())
Expect(test.ExitCode()).To(BeZero())
test = podmanTest.Podman([]string{"events", "--stream=false", "--format", "{{json.}}"})
test.WaitWithDefaultTimeout()
fmt.Println(test.OutputToStringArray())
jsonArr = test.OutputToStringArray()
Expect(len(jsonArr)).To(Not(BeZero()))
eventsMap = make(map[string]string)
err = json.Unmarshal([]byte(jsonArr[0]), &eventsMap)
if err != nil {
os.Exit(1)
}
_, exist = eventsMap["Status"]
Expect(exist).To(BeTrue())
Expect(test.ExitCode()).To(BeZero())
})
})