mirror of
https://github.com/containerd/containerd.git
synced 2026-06-24 08:48:48 +00:00
Merge commit from fork
This commit is contained in:
@@ -110,7 +110,7 @@ function test_from_archive() {
|
||||
fi
|
||||
# Cleanup
|
||||
echo "--> Cleanup images: "
|
||||
crictl rmi "${TEST_IMAGE}" | sed 's/^/----> \t/'
|
||||
(crictl rmi "${TEST_IMAGE}" || true) | sed 's/^/----> \t/'
|
||||
echo -n "--> Verifying container rootfs: "
|
||||
crictl exec "$ctr_id" ls -la /root/testfile
|
||||
if crictl exec "$ctr_id" ls -la /etc/motd >/dev/null 2>&1; then
|
||||
@@ -184,7 +184,7 @@ function test_from_oci() {
|
||||
echo "--> Cleanup images: "
|
||||
../../bin/ctr -n k8s.io images rm localhost/checkpoint-image:latest | sed 's/^/----> \t/'
|
||||
echo "--> Cleanup images: "
|
||||
crictl rmi "${TEST_IMAGE}" | sed 's/^/----> \t/'
|
||||
(crictl rmi "${TEST_IMAGE}" || true) | sed 's/^/----> \t/'
|
||||
echo "--> Deleting all pods: "
|
||||
crictl -t 5s rmp -fa | sed 's/^/----> \t/'
|
||||
SUCCESS=1
|
||||
|
||||
@@ -413,23 +413,6 @@ func (c *criService) CRImportCheckpoint(
|
||||
if _, err := reference.ParseAnyReference(config.RootfsImageName); err != nil {
|
||||
return "", fmt.Errorf("error parsing reference: %q is not a valid repository/tag %v", config.RootfsImageName, err)
|
||||
}
|
||||
tagImage, err := c.client.ImageService().Get(ctx, config.RootfsImageRef)
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to get checkpoint base image %s: %w", config.RootfsImageRef, err)
|
||||
}
|
||||
// Second step is to tag the image with the same tag it used to have
|
||||
// during checkpointing. For the error that the image NAME:TAG already
|
||||
// exists is ignored. It could happen that NAME:TAG now belongs to
|
||||
// another NAME@DIGEST than during checkpointing and the restore will
|
||||
// happen on another image.
|
||||
// TODO: handle if NAME:TAG points to a different NAME@DIGEST
|
||||
tagImage.Name = config.RootfsImageName
|
||||
_, err = c.client.ImageService().Create(ctx, tagImage)
|
||||
if err != nil {
|
||||
if !errdefs.IsAlreadyExists(err) {
|
||||
return "", fmt.Errorf("failed to tag checkpoint base image %s with %s: %w", config.RootfsImageRef, config.RootfsImageName, err)
|
||||
}
|
||||
}
|
||||
|
||||
var image imagestore.Image
|
||||
for i := 1; i < 500; i++ {
|
||||
|
||||
Reference in New Issue
Block a user