Skip to content

Commit

Permalink
[TESTING] rbd-group-snapshots use rbd.CloneImageByID()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
nixpanic committed Jun 25, 2024
1 parent 2cb4354 commit 2b020ca
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions build.env
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions tools/rbd-group-snapshot/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -243,6 +242,7 @@ func (rgt *rbdGroupTest) restoreFromSnapshot() {
*/

// alternative to the above
/*
snapname := "tmp-snap"
snap, err := img.CreateSnapshot(snapname)
if err != nil {
Expand Down Expand Up @@ -273,6 +273,7 @@ func (rgt *rbdGroupTest) restoreFromSnapshot() {
if err != nil {
panic(err)
}
*/
}

func (rgt *rbdGroupTest) removeRestoredImage() {
Expand Down

0 comments on commit 2b020ca

Please sign in to comment.