Skip to content

Commit

Permalink
Docker compat: Return null when swappiness is -1
Browse files Browse the repository at this point in the history
Fixes: #23824

Signed-off-by: Nicola Sella <[email protected]>
  • Loading branch information
inknos committed Oct 3, 2024
1 parent 13b78c9 commit e1f54b6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/api/handlers/compat/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,10 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON,
}
sort.Strings(hc.Binds)

// Docker reports null instead of 0 for unset Swappiness
if *hc.MemorySwappiness == -1 {
hc.MemorySwappiness = nil
}
// k8s-file == json-file
if hc.LogConfig.Type == define.KubernetesLogging {
hc.LogConfig.Type = define.JSONLogging
Expand Down

0 comments on commit e1f54b6

Please sign in to comment.