From 31cc2c554e9209ca8ec489db189fb63253ca34d6 Mon Sep 17 00:00:00 2001 From: travisn Date: Mon, 31 Jul 2023 11:15:24 -0600 Subject: [PATCH] tests: toolbox uses same ceph image as the test The test is currently only using the ceph version that is included with toolbox.yaml, which may be different from the version of the ceph cluster being tested. Now the version will be replaced to match the desired ceph test version. Signed-off-by: travisn (cherry picked from commit 600068ea21447b0345c9a2033a21f82a799b8d65) --- tests/framework/installer/ceph_manifests.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/framework/installer/ceph_manifests.go b/tests/framework/installer/ceph_manifests.go index f40109e8b..7e7b206ba 100644 --- a/tests/framework/installer/ceph_manifests.go +++ b/tests/framework/installer/ceph_manifests.go @@ -18,6 +18,7 @@ package installer import ( "fmt" + "regexp" "strconv" "strings" @@ -112,7 +113,12 @@ func (m *CephManifestsMaster) GetToolbox() string { manifest = strings.ReplaceAll(manifest, "name: rook-direct-mount", "name: rook-ceph-tools") return strings.ReplaceAll(manifest, "app: rook-direct-mount", "app: rook-ceph-tools") } - return m.settings.readManifest("toolbox.yaml") + manifest := m.settings.readManifest("toolbox.yaml") + // The toolbox uses the ceph image, so replace the version that is being tested + // The regex allows for any character in the tag ("\S" --> non-whitespace character) + versionRegex := regexp.MustCompile(`image: quay.io/ceph/ceph:\S+`) + manifest = versionRegex.ReplaceAllString(manifest, "image: "+m.settings.CephVersion.Image) + return manifest } //**********************************************************************************