mirror of
https://github.com/containers/podman.git
synced 2026-08-07 04:43:04 -04:00
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:
1 parent
7e9ed37c09
commit
28ffe74e44
3 files changed
+19
-1
No files matched your search
@@ -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())
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user