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 <tnielsen@redhat.com>
(cherry picked from commit 600068ea21)
This commit is contained in:
travisn authored and Mergify committed 2023-07-31 21:07:10 +00:00
1 parent dd79c1f78d
commit 31cc2c554e
1 file changed
+7 -1
+7 -1
View File
@@ -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
}
//**********************************************************************************