1
0
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:
Sebastiaan van Steenis
2018-07-02 12:29:24 +02:00
committed by Alena Prokharchyk
parent 70f482611c
commit 56e6765b58

View File

@@ -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."