mirror of
https://github.com/rancher/rke.git
synced 2025-08-31 22:46:25 +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 (
|
||||
"os"
|
||||
"regexp"
|
||||
|
||||
"github.com/rancher/rke/cmd"
|
||||
"github.com/sirupsen/logrus"
|
||||
@@ -9,6 +10,7 @@ import (
|
||||
)
|
||||
|
||||
var VERSION = "v0.0.12-dev"
|
||||
var released = regexp.MustCompile(`^v[0-9]+\.[0-9]+\.[0-9]+$`)
|
||||
|
||||
func main() {
|
||||
if err := mainErr(); err != nil {
|
||||
@@ -26,6 +28,10 @@ func mainErr() error {
|
||||
logrus.SetLevel(logrus.DebugLevel)
|
||||
}
|
||||
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
|
||||
}
|
||||
app.Author = "Rancher Labs, Inc."
|
||||
|
Reference in New Issue
Block a user