vendor: OCI Image Spec v1.0.0-rc6
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
@@ -104,24 +104,20 @@ var checkpointCommand = cli.Command{
|
||||
return err
|
||||
}
|
||||
}
|
||||
var index ocispec.ImageIndex
|
||||
var index ocispec.Index
|
||||
for _, d := range append(checkpoint.Descriptors, additionalDescriptors...) {
|
||||
index.Manifests = append(index.Manifests, ocispec.ManifestDescriptor{
|
||||
Descriptor: ocispec.Descriptor{
|
||||
MediaType: d.MediaType,
|
||||
Size: d.Size_,
|
||||
Digest: d.Digest,
|
||||
},
|
||||
Platform: ocispec.Platform{
|
||||
index.Manifests = append(index.Manifests, ocispec.Descriptor{
|
||||
MediaType: d.MediaType,
|
||||
Size: d.Size_,
|
||||
Digest: d.Digest,
|
||||
Platform: &ocispec.Platform{
|
||||
OS: runtime.GOOS,
|
||||
Architecture: runtime.GOARCH,
|
||||
},
|
||||
})
|
||||
}
|
||||
// add image to the index
|
||||
index.Manifests = append(index.Manifests, ocispec.ManifestDescriptor{
|
||||
Descriptor: image.Target,
|
||||
})
|
||||
index.Manifests = append(index.Manifests, image.Target)
|
||||
// checkpoint rw layer
|
||||
snapshotter, err := getSnapshotter(context)
|
||||
if err != nil {
|
||||
@@ -135,13 +131,11 @@ var checkpointCommand = cli.Command{
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
index.Manifests = append(index.Manifests, ocispec.ManifestDescriptor{
|
||||
Descriptor: rw,
|
||||
Platform: ocispec.Platform{
|
||||
OS: runtime.GOOS,
|
||||
Architecture: runtime.GOARCH,
|
||||
},
|
||||
})
|
||||
rw.Platform = &ocispec.Platform{
|
||||
OS: runtime.GOOS,
|
||||
Architecture: runtime.GOARCH,
|
||||
}
|
||||
index.Manifests = append(index.Manifests, rw)
|
||||
data, err := json.Marshal(index)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -132,7 +132,7 @@ var runCommand = cli.Command{
|
||||
}
|
||||
var spec []byte
|
||||
if checkpointIndex != "" {
|
||||
var index ocispec.ImageIndex
|
||||
var index ocispec.Index
|
||||
r, err := content.Reader(ctx, checkpointIndex)
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -146,7 +146,7 @@ var runCommand = cli.Command{
|
||||
for _, m := range index.Manifests {
|
||||
switch m.MediaType {
|
||||
case images.MediaTypeContainerd1Checkpoint:
|
||||
fkingo := m.Descriptor
|
||||
fkingo := m
|
||||
checkpoint = &fkingo
|
||||
case images.MediaTypeContainerd1CheckpointConfig:
|
||||
if r, err = content.Reader(ctx, m.Digest); err != nil {
|
||||
@@ -159,7 +159,7 @@ var runCommand = cli.Command{
|
||||
}
|
||||
case images.MediaTypeDockerSchema2Manifest:
|
||||
// make sure we have the original image that was used during checkpoint
|
||||
diffIDs, err := images.RootFS(ctx, content, m.Descriptor)
|
||||
diffIDs, err := images.RootFS(ctx, content, m)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
@@ -169,7 +169,7 @@ var runCommand = cli.Command{
|
||||
}
|
||||
}
|
||||
case ocispec.MediaTypeImageLayer:
|
||||
rw = m.Descriptor
|
||||
rw = m
|
||||
}
|
||||
}
|
||||
if mounts, err = snapshotter.Mounts(ctx, id); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user