Skip to content

Commit

Permalink
core: allow dev version of lima (#864)
Browse files Browse the repository at this point in the history
* Allow using brew installed dev version of lima.

* update warning message

---------

Co-authored-by: Abiola Ibrahim <[email protected]>
  • Loading branch information
terev and abiosoft authored Nov 15, 2023
1 parent 5c68fa0 commit ac7e9f6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions core/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bytes"
"encoding/json"
"fmt"
"github.com/sirupsen/logrus"
"strings"

"github.com/abiosoft/colima/cli"
Expand Down Expand Up @@ -120,8 +121,14 @@ func LimaVersionSupported() error {
return fmt.Errorf("error decoding 'limactl info' json: %w", err)
}
// remove pre-release hyphen
if str := strings.SplitN(values.Version, "-", 2); len(str) > 0 {
values.Version = str[0]
parts := strings.SplitN(values.Version, "-", 2)
if len(parts) > 0 {
values.Version = parts[0]
}

if parts[0] == "HEAD" {
logrus.Warnf("to avoid compatibility issues, ensure lima development version (%s) in use is not lower than %s", values.Version, limaVersion)
return nil
}

min := semver.New(strings.TrimPrefix(limaVersion, "v"))
Expand Down

0 comments on commit ac7e9f6

Please sign in to comment.