check correctness of orchestrator version format
@@ -82,7 +82,10 @@ func GetValidPatchVersion(orchType, orchVer string) string {
orchVer)
if version == "" {
- sv, _ := semver.NewVersion(orchVer)
+ sv, err := semver.NewVersion(orchVer)
+ if err != nil {
+ return ""
+ }
sr := fmt.Sprintf("%d.%d", sv.Major(), sv.Minor())
version = RationalizeReleaseAndVersion(
@@ -102,7 +105,9 @@ func RationalizeReleaseAndVersion(orchType, orchRel, orchVer string) (version st
if orchRel == "" && orchVer == "" {
return defaultVersion
- } else if orchVer == "" {
+ }
+
+ if orchVer == "" {
// Try to get latest version matching the release
version = ""
for _, ver := range supportedVersions {
