-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: /image/{name or id}/json returns RootFS layers #8109
fix: /image/{name or id}/json returns RootFS layers #8109
Conversation
Signed-off-by: Matej Vasek <[email protected]>
/approve |
Thanks @matejvasek |
LGTM |
I just added some nil checks, |
Signed-off-by: Matej Vasek <[email protected]>
52bfbd6
to
5098048
Compare
pkg/api/handlers/types.go
Outdated
@@ -271,6 +271,15 @@ func ImageDataToImageInspect(ctx context.Context, l *libpodImage.Image) (*ImageI | |||
if err != nil { | |||
return nil, err | |||
} | |||
|
|||
rootfs := docker.RootFS{} | |||
if info.RootFS != nil && info.RootFS.Layers != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be split? i.e. test RootFS for nil and then set RootFS.Type if it is not nil, then test for RootFS.Layers and set that if it is not nil.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed that. It turned out that it's OK to call len()
and range
on nil slice.
Signed-off-by: Matej Vasek <[email protected]>
Thanks @matejvasek |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: matejvasek, mheon, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/hold cancel |
Signed-off-by: Matej Vasek [email protected]