Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
clh: update minimal supported version to check.
Browse files Browse the repository at this point in the history
Kata now uses v0.5.0 and is not compatible with old versions.

Signed-off-by: Jose Carlos Venegas Munoz <[email protected]>
  • Loading branch information
jcvenegas committed Feb 20, 2020
1 parent 2033229 commit 3345977
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions virtcontainers/clh.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const (
virtioFsSocket = "virtiofsd.sock"
clhSerial = "serial-tty.log"
supportedMajorVersion = 0
supportedMinorVersion = 3
supportedMinorVersion = 5
defaultClhPath = "/usr/local/bin/cloud-hypervisor"
virtioFsCacheAlways = "always"
maxClhVcpus = uint32(64)
Expand Down Expand Up @@ -676,7 +676,6 @@ func (clh *cloudHypervisor) getAvailableVersion() error {
}

// Remove 'v' prefix if has one
clh.Logger().Error("DEBUG :", versionSplit[0])
versionSplit[0] = strings.TrimLeft(versionSplit[0], "v")
major, err := strconv.ParseUint(versionSplit[0], 10, 64)
if err != nil {
Expand All @@ -689,11 +688,12 @@ func (clh *cloudHypervisor) getAvailableVersion() error {

}

revisionStr := strings.SplitN(versionSplit[2], "-", -1)
if len(revisionStr) < 1 {
return errors.Errorf("Failed parse clh revision %s", versionSplit[2])
// revision could have aditional commit information separated by '-'
revisionSplit := strings.SplitN(versionSplit[2], "-", -1)
if len(revisionSplit) < 1 {
return errors.Errorf("Failed parse cloud-hypervisor revision %s", versionSplit[2])
}
revision, err := strconv.ParseUint(revisionStr[0], 10, 64)
revision, err := strconv.ParseUint(revisionSplit[0], 10, 64)
if err != nil {
return err
}
Expand Down

0 comments on commit 3345977

Please sign in to comment.