Skip to content

Commit

Permalink
Treat image tag without semver compatible prefix as bleeding edge ver…
Browse files Browse the repository at this point in the history
…sion
  • Loading branch information
SaaldjorMike committed Oct 24, 2023
1 parent d1adae9 commit 7354ed9
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions controllers/humiocluster_version.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,18 @@ func HumioVersionFromString(image string) (*HumioVersion, error) {
return &humioVersion, nil
}

if nodeImage[1] == "latest" || nodeImage[1] == "master" {
humioVersion.assumeLatest = true
return &humioVersion, nil
}

// strip commit SHA if it exists
nodeImage = strings.SplitN(nodeImage[1], "-", 2)

nodeImageVersion, err := semver.NewVersion(nodeImage[0])
if err != nil {
return &humioVersion, err
// since image does not include any version hints, we assume bleeding edge version
humioVersion.assumeLatest = true
return &humioVersion, nil
}

humioVersion.version = nodeImageVersion
return &humioVersion, err
return &humioVersion, nil
}

func (hv *HumioVersion) AtLeast(version string) (bool, error) {
Expand Down

0 comments on commit 7354ed9

Please sign in to comment.