From 2b020ca8f81b68e5d76fd3fbc078fb4b4d3e11a6 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Mon, 24 Jun 2024 17:51:50 +0200 Subject: [PATCH] [TESTING] rbd-group-snapshots use rbd.CloneImageByID() The new rbd_clone4() API is only available in Squid and newer. Squid is not yet released, therefor it is required to use the container image from the Ceph CI registry. rbd_clone() is added in PR ceph/go-ceph#1000, that branch needs to be vendored as well. --- Makefile | 2 +- build.env | 4 ++-- tools/rbd-group-snapshot/main.go | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 57024dc20f9..8e3e03520e4 100644 --- a/Makefile +++ b/Makefile @@ -169,7 +169,7 @@ e2e.test: check-env .PHONY: rbd-group-snapshot rbd-group-snapshot: - go build -o _output/rbd-group-snapshot ./tools/rbd-group-snapshot + go build $(GO_TAGS) -o _output/rbd-group-snapshot ./tools/rbd-group-snapshot # # Update the generated deploy/ files when the template changed. This requires diff --git a/build.env b/build.env index 1d7c372d7b5..4880b16f29e 100644 --- a/build.env +++ b/build.env @@ -15,8 +15,8 @@ CSI_IMAGE_VERSION=canary CSI_UPGRADE_VERSION=v3.11.0 # Ceph version to use -BASE_IMAGE=quay.io/ceph/ceph:v18 -CEPH_VERSION=reef +BASE_IMAGE=quay.ceph.io/ceph-ci/ceph:squid +CEPH_VERSION=squid # standard Golang options GOLANG_VERSION=1.22.2 diff --git a/tools/rbd-group-snapshot/main.go b/tools/rbd-group-snapshot/main.go index 22e7d5fbd22..e11b538ab18 100644 --- a/tools/rbd-group-snapshot/main.go +++ b/tools/rbd-group-snapshot/main.go @@ -205,7 +205,6 @@ func (rgt *rbdGroupTest) restoreFromSnapshot() { // panic(err) // } -/* fmt.Printf("restoring image %q from parent %q at snapshot %q\n", restoreName, imageNames[0], snaps[0].Name) snap := img.GetSnapshot(snaps[0].Name) err = snap.Protect() @@ -214,11 +213,11 @@ func (rgt *rbdGroupTest) restoreFromSnapshot() { } defer snap.Unprotect() - err = rbd.CloneFromImage(img, snaps[0].Name, rgt.ioctx, restoreName, options) + //err = rbd.CloneFromImage(img, snaps[0].Name, rgt.ioctx, restoreName, options) + err = rbd.CloneImageByID(rgt.ioctx, imageNames[0], snaps[0].Id, rgt.ioctx, restoreName, options) if err != nil { panic(err) } -*/ /* // alternative to the above -- segfaults, needs a snapshot @@ -243,6 +242,7 @@ func (rgt *rbdGroupTest) restoreFromSnapshot() { */ // alternative to the above +/* snapname := "tmp-snap" snap, err := img.CreateSnapshot(snapname) if err != nil { @@ -273,6 +273,7 @@ func (rgt *rbdGroupTest) restoreFromSnapshot() { if err != nil { panic(err) } +*/ } func (rgt *rbdGroupTest) removeRestoredImage() {