Skip to content

Commit

Permalink
Merge pull request #27 from alexmasi/ga
Browse files Browse the repository at this point in the history
Support 'ga' tag as an engineering build
  • Loading branch information
hellt authored Nov 19, 2022
2 parents 486959c + f53de9d commit df52b70
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api/types/v1alpha1/srl_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ type SrlVersion struct {
}

func parseVersionString(s string) (*SrlVersion, error) {
// for latest or missing tag we consider the version to be an engineering build
// with major = 0
if strings.ToLower(s) == "latest" || s == "" {
return &SrlVersion{"0", "", "", "", ""}, nil
// Check if the version string is an engineering build with major = 0
engineeringVersions := []string{"", "latest", "ga"}
for _, ver := range engineeringVersions {
if ver == strings.ToLower(s) {
return &SrlVersion{"0", "", "", "", ""}, nil
}
}

// https://regex101.com/r/eWS6Ms/3
Expand Down
5 changes: 5 additions & 0 deletions api/types/v1alpha1/srl_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@ func TestParseVersionString(t *testing.T) {
got: "latest",
want: &SrlVersion{"0", "", "", "", ""},
},
{
desc: "ga",
got: "ga",
want: &SrlVersion{"0", "", "", "", ""},
},
{
desc: "empty",
got: "",
Expand Down

0 comments on commit df52b70

Please sign in to comment.