Skip to content
This repository was archived by the owner on Jan 11, 2023. It is now read-only.

check correctness of orchestrator version format #1924

Merged
merged 1 commit into from
Dec 12, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pkg/api/common/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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 {
Expand Down