mirror of
https://github.com/opencontainers/runc.git
synced 2025-09-26 19:41:35 +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:
@@ -75,8 +75,8 @@ type CpuUsage struct {
|
||||
}
|
||||
|
||||
type Cpu struct {
|
||||
Usage CpuUsage `json:"usage,omitempty"`
|
||||
Throttling Throttling `json:"throttling,omitempty"`
|
||||
Usage CpuUsage `json:"usage,omitzero"`
|
||||
Throttling Throttling `json:"throttling,omitzero"`
|
||||
PSI *PSIStats `json:"psi,omitempty"`
|
||||
}
|
||||
|
||||
@@ -103,10 +103,10 @@ type MemoryEntry struct {
|
||||
|
||||
type Memory struct {
|
||||
Cache uint64 `json:"cache,omitempty"`
|
||||
Usage MemoryEntry `json:"usage,omitempty"`
|
||||
Swap MemoryEntry `json:"swap,omitempty"`
|
||||
Kernel MemoryEntry `json:"kernel,omitempty"`
|
||||
KernelTCP MemoryEntry `json:"kernelTCP,omitempty"`
|
||||
Usage MemoryEntry `json:"usage,omitzero"`
|
||||
Swap MemoryEntry `json:"swap,omitzero"`
|
||||
Kernel MemoryEntry `json:"kernel,omitzero"`
|
||||
KernelTCP MemoryEntry `json:"kernelTCP,omitzero"`
|
||||
Raw map[string]uint64 `json:"raw,omitempty"`
|
||||
PSI *PSIStats `json:"psi,omitempty"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user