tests: multi cluster suite toolbox version

The toolbox image tag was always being set from #12625
even when the image was not set in the test. If the image
is not set, skip replacing the image name to use the default
test version.

Signed-off-by: travisn <tnielsen@redhat.com>
This commit is contained in:
travisn committed 2023-07-31 16:18:24 -06:00
1 parent 9d789e3898
commit c17724b536
1 file changed
+6 -4
+6 -4
View File
@@ -114,10 +114,12 @@ func (m *CephManifestsMaster) GetToolbox() string {
return strings.ReplaceAll(manifest, "app: rook-direct-mount", "app: rook-ceph-tools")
}
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)
if m.settings.CephVersion.Image != "" {
// 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
}