[fixed] version parsing issue that got tripped by extra .

This broke due to the RC portion 2.2.1.RC1 without -

Signed-off-by: Matthias Hanel <mh@synadia.com>
This commit is contained in:
Matthias Hanel
2021-03-22 20:48:10 -04:00
parent 0a48911c00
commit 3619b186c6

View File

@@ -112,7 +112,8 @@ func validateTrustedOperators(o *Options) error {
return fmt.Errorf("system_account in config and operator JWT must be identical")
}
}
srvMajor, srvMinor, srvUpdate, _ := jwt.ParseServerVersion(strings.Split(VERSION, "-")[0])
ver := strings.Split(strings.Split(VERSION, "-")[0], ".RC")[0]
srvMajor, srvMinor, srvUpdate, _ := jwt.ParseServerVersion(ver)
for _, opc := range o.TrustedOperators {
if major, minor, update, err := jwt.ParseServerVersion(opc.AssertServerVersion); err != nil {
return fmt.Errorf("operator %s expects version %s got error instead: %s",