mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
types/events: use omitzero where appropriate
In these cases, omitempty doesn't really work so it is useless, but omitzero actually works. As a result, output of `runc events` may omit these fields if all they contain are zeroes. NOTE this might be a breaking change. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
+6
-6
@@ -75,8 +75,8 @@ type CpuUsage struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Cpu struct {
|
type Cpu struct {
|
||||||
Usage CpuUsage `json:"usage,omitempty"`
|
Usage CpuUsage `json:"usage,omitzero"`
|
||||||
Throttling Throttling `json:"throttling,omitempty"`
|
Throttling Throttling `json:"throttling,omitzero"`
|
||||||
PSI *PSIStats `json:"psi,omitempty"`
|
PSI *PSIStats `json:"psi,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -103,10 +103,10 @@ type MemoryEntry struct {
|
|||||||
|
|
||||||
type Memory struct {
|
type Memory struct {
|
||||||
Cache uint64 `json:"cache,omitempty"`
|
Cache uint64 `json:"cache,omitempty"`
|
||||||
Usage MemoryEntry `json:"usage,omitempty"`
|
Usage MemoryEntry `json:"usage,omitzero"`
|
||||||
Swap MemoryEntry `json:"swap,omitempty"`
|
Swap MemoryEntry `json:"swap,omitzero"`
|
||||||
Kernel MemoryEntry `json:"kernel,omitempty"`
|
Kernel MemoryEntry `json:"kernel,omitzero"`
|
||||||
KernelTCP MemoryEntry `json:"kernelTCP,omitempty"`
|
KernelTCP MemoryEntry `json:"kernelTCP,omitzero"`
|
||||||
Raw map[string]uint64 `json:"raw,omitempty"`
|
Raw map[string]uint64 `json:"raw,omitempty"`
|
||||||
PSI *PSIStats `json:"psi,omitempty"`
|
PSI *PSIStats `json:"psi,omitempty"`
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user