mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api/container_inspect: Ensure Config is not nil in inspect response
Ensure that the JSON response for the `GET /containers/{name}/json`
outputs an empty object instead of a nil config.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -81,5 +81,8 @@ func (c *containerRouter) getContainersByName(ctx context.Context, w http.Respon
|
||||
}
|
||||
}
|
||||
|
||||
if ctr.Config == nil {
|
||||
ctr.Config = &container.Config{}
|
||||
}
|
||||
return httputils.WriteJSON(w, http.StatusOK, compat.Wrap(ctr, wrapOpts...))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user