-
Notifications
You must be signed in to change notification settings - Fork 349
adding info map for verbose image status #470
Conversation
|
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 think we can rename the name corresponding with OCI, like:
imageConfig
-> config
imageConfigDescriptor
-> configDescriptor
imageTargetDescriptor
-> manifestDescribor
imageTargetDigestsInfo
-> layerInfo
wdyt?
pkg/server/image_status.go
Outdated
if err != nil { | ||
info["imageTargetDigests"] = err.Error() | ||
} else { | ||
info["imageTargetDigests"] = marshallToString(digests) |
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 think imageTargetDigests
is redundant since imageTargetDigestsInfo
have contained this content.
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.
changed my mind, sounds good..
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.
and done..
I like it! Will do. and done |
Updated example output:
|
/lgtm |
pkg/server/image_status.go
Outdated
glog.Errorf("Failed to get target digests %q: %v", i.Name(), err) | ||
} else { | ||
dia = make([]content.Info, len(digests)) | ||
for i, d := range digests { |
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.
This is wrong. RootFS
digest is uncompressed digest, content is compressed.
You won't be able to get things from content store info with RootFS digest:
{
"status": {
"id": "sha256:c30178c5239f2937c21c261b0365efcda25be4921ccb95acd63beeeb78786f27",
"repoTags": [
"docker.io/library/busybox:1.26"
],
"repoDigests": [
"docker.io/library/busybox@sha256:be3c11fdba7cfe299214e46edc642e09514dbb9bbefcd0d3836c05a1e0cd0642"
],
"size": "701277",
"username": ""
},
"info": {
"config": {
"Env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"Cmd": [
"sh"
]
},
"configDescriptor": {
"mediaType": "application/vnd.docker.container.image.v1+json",
"digest": "sha256:c30178c5239f2937c21c261b0365efcda25be4921ccb95acd63beeeb78786f27",
"size": 1507
},
"manifestDescriptor": {
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"digest": "sha256:be3c11fdba7cfe299214e46edc642e09514dbb9bbefcd0d3836c05a1e0cd0642",
"size": 527
},
"layerInfo": [
{
"Digest": "",
"Size": 0,
"CreatedAt": "0001-01-01T00:00:00Z",
"UpdatedAt": "0001-01-01T00:00:00Z",
"Labels": null
}
]
}
}
We may want to include the whole image spec imagespec.Image
, which has already contained everything.
We also need ChainID here, because that's how we find the corresponding snapshot in containerd.
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.
Agree we should omit, if content isn't accessible.
Agree, we may want to include the whole imagespec.Image.
Agree, to add chainID.
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.
@mikebrow You could change imagestore.Image.Config
to imagestore.Image.ImageSpec
and change all the other referencing place.
So that you don't need to read that from containerd again.
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.
@Random-Liu added a commit to place the full OCI image spec into the imagestore.. Debugging it now.
Signed-off-by: Mike Brown <[email protected]>
Updated inspect:
|
Signed-off-by: Mike Brown <[email protected]>
comments addressed. |
@mikebrow THIS LOOKS COOL! |
Config *imagespec.ImageConfig | ||
// ImageSpec is the oci image structure which describes basic information about the image. | ||
ImageSpec imagespec.Image | ||
|
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.
Unnecessary empty line. I'll clean this up in my coming cleanup PR.
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.
ok....?
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.
Done.
}, | ||
{ | ||
ID: "sha256:2123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef", | ||
ChainID: "test-chain-id-2abcd", | ||
RepoTags: []string{"tag-2abcd"}, | ||
RepoDigests: []string{"digest-2abcd"}, | ||
Size: 20, | ||
Config: &imagespec.ImageConfig{}, |
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.
Why removing this? Will add it back in my cleanup PR.
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.
because the config is in the image struct...
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.
Cleanup?
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.
Done.
/lgtm |
This commit addresses #359 image status debug, adds verbose info to image status request, and also does some refactoring.
Signed-off-by: Mike Brown [email protected]