mirror of
https://github.com/rancher/rke.git
synced 2025-09-06 09:20:06 +00:00
Add warning when using unreleased version
This commit is contained in:
committed by
Alena Prokharchyk
parent
70f482611c
commit
56e6765b58
6
main.go
6
main.go
@@ -2,6 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
|
"regexp"
|
||||||
|
|
||||||
"github.com/rancher/rke/cmd"
|
"github.com/rancher/rke/cmd"
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
@@ -9,6 +10,7 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var VERSION = "v0.0.12-dev"
|
var VERSION = "v0.0.12-dev"
|
||||||
|
var released = regexp.MustCompile(`^v[0-9]+\.[0-9]+\.[0-9]+$`)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
if err := mainErr(); err != nil {
|
if err := mainErr(); err != nil {
|
||||||
@@ -26,6 +28,10 @@ func mainErr() error {
|
|||||||
logrus.SetLevel(logrus.DebugLevel)
|
logrus.SetLevel(logrus.DebugLevel)
|
||||||
}
|
}
|
||||||
logrus.Debugf("RKE version %s", app.Version)
|
logrus.Debugf("RKE version %s", app.Version)
|
||||||
|
if released.MatchString(app.Version) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
logrus.Warnf("This is not an officially supported version (%s) of RKE. Please download the latest official release at https://github.com/rancher/rke/releases/latest", app.Version)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
app.Author = "Rancher Labs, Inc."
|
app.Author = "Rancher Labs, Inc."
|
||||||
|
Reference in New Issue
Block a user