Commit f433efef authored by Zach Loafman's avatar Zach Loafman

Merge pull request #13042 from yifan-gu/rkt_fix_version

kubelet/rkt: fix rkt version parsing.
parents 9a8eef33 a2b148b2
......@@ -21,25 +21,18 @@ import (
"os/exec"
"strconv"
"strings"
appctypes "github.com/appc/spec/schema/types"
)
type rktVersion []int
func parseVersion(input string) (rktVersion, error) {
tail := strings.Index(input, "+")
if tail > 0 {
input = input[:tail]
}
var result rktVersion
tuples := strings.Split(input, ".")
for _, t := range tuples {
n, err := strconv.Atoi(t)
if err != nil {
return nil, err
}
result = append(result, n)
nsv, err := appctypes.NewSemVer(input)
if err != nil {
return nil, err
}
return result, nil
return rktVersion{int(nsv.Major), int(nsv.Minor), int(nsv.Patch)}, nil
}
func (r rktVersion) Compare(other string) (int, error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment