Skip to content

Conversation

loheagn
Copy link
Contributor

@loheagn loheagn commented Sep 28, 2022

This patch fixes some bugs in image conversion using LayerConvertFunc and ConvertHookFunc.

  1. append nydus.remoteimage.v1 to os.features of the manifest descriptor in the index
  2. add "containerd.io/snapshot/nydus-blob": "true" to the annotations of the blob layer descriptor in the manifest
  3. avoid appending duplicate bootstrap layer digest to the diffID list of the config

This patch also adds a smoke test TestContainerdImageConvert to make sure LayerConvertFunc and ConvertHookFunc work well with the containerd image conversion library.

Signed-off-by: Nan Li loheagn@icloud.com

Copy link
Collaborator

@imeoer imeoer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution!

return nil, errors.Wrap(err, "read target image index json")
}
// isManifestModified is a function to check whether the manifest is modified.
isManifestModified := func(manifest ocispec.Descriptor) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can check whether it is nydus manifest (name it isNydusManifest) by recognizing bootstrap annotation, which would be safer?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we need to read json from the content store for each manifest descriptor.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can store the modified manifest digest in a map in the manifest conversion hook?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, just checking if the manifest is changed should also work.

@loheagn loheagn force-pushed the fix-image-convert-index branch from e26e440 to df536dc Compare September 28, 2022 03:31
@loheagn loheagn force-pushed the fix-image-convert-index branch from df536dc to f310f09 Compare September 28, 2022 03:51
@loheagn
Copy link
Contributor Author

loheagn commented Sep 28, 2022

@imeoer Can you please rerun the action? There may be a network error. Thanks :)

@imeoer
Copy link
Collaborator

imeoer commented Sep 28, 2022

/retest

@changweige
Copy link
Member

The current main branch has Golang race problem, which fails this PR. I will fix it

@changweige
Copy link
Member

Please rebase to the latest main branch.

…rtHookFunc`.

1. append `nydus.remoteimage.v1` to `os.features` of the manifest descriptor in the index
2. add `"containerd.io/snapshot/nydus-blob": "true"` to the annotations of the blob layer descriptor in the manifest
3. avoid appending duplicate bootstrap layer digest to the diffID list of the config

This commit also adds a smoke test `TestContainerdImageConvert` to make sure `LayerConvertFunc` and `ConvertHookFunc` work well with the containerd image conversion library.

Signed-off-by: Nan Li <loheagn@icloud.com>
@loheagn loheagn force-pushed the fix-image-convert-index branch from f310f09 to 528734c Compare September 28, 2022 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants