Skip to content

Commit 64042d8

Browse files
redbeampraveenkumar
authored andcommitted
bundle validation: expand regex
to allow more characters in bundle version field Issue #4409
1 parent b174d0c commit 64042d8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

pkg/crc/machine/bundle/metadata.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func GetBundleInfoFromName(bundleName string) (*FilenameInfo, error) {
257257
var filenameInfo FilenameInfo
258258

259259
// crc_preset_driver_version_arch_customSuffix.crcbundle
260-
bundleNameRegex := regexp.MustCompile(`crc(?:(?:_)([[:alpha:]]+))?_([[:alpha:]]+)_([0-9.]+)_([[:alnum:]]+)(?:(?:_)([0-9]+))?\.crcbundle`)
260+
bundleNameRegex := regexp.MustCompile(`crc(?:(?:_)([[:alpha:]]+))?_([[:alpha:]]+)_([[:alnum:].-]+)_([[:alnum:]]+)(?:(?:_)([0-9]+))?\.crcbundle`)
261261
filenameParts := bundleNameRegex.FindStringSubmatch(bundleName)
262262

263263
if filenameParts == nil {

pkg/crc/machine/bundle/metadata_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ func TestGetBundleInfoFromNameValid(t *testing.T) {
222222
{"crc_okd_vfkit_4.16.7_amd64.crcbundle", preset.OKD.String(), "vfkit", "4.16.7", "amd64", ""},
223223
{"crc_okd_vfkit_4.16.7_amd64_2342465234654.crcbundle", preset.OKD.String(), "vfkit", "4.16.7", "amd64", "2342465234654"},
224224
{"crc_hyperv_4.18.0_arm64.crcbundle", preset.OpenShift.String(), "hyperv", "4.18.0", "arm64", ""},
225+
{"crc_libvirt_4.18.0-ec.2_amd64.crcbundle", preset.OpenShift.String(), "libvirt", "4.18.0-ec.2", "amd64", ""},
225226

226227
{"crc_hyperv_4.18_x86.crcbundle", preset.OpenShift.String(), "hyperv", "4.18", "x86", ""},
227228
{"crc_microshift_hyperv_4.18_x86.crcbundle", preset.Microshift.String(), "hyperv", "4.18", "x86", ""},

0 commit comments

Comments
 (0)