From 58ead2accc36d7bae1d37f80d1b43023f43b01e0 Mon Sep 17 00:00:00 2001 From: Matthias Hanel Date: Wed, 17 Mar 2021 16:50:48 -0400 Subject: [PATCH] Changed version numbers and descriptions for jwt update scenarios Signed-off-by: Matthias Hanel --- cmd/root.go | 5 +++-- cmd/upgradejwt.go | 7 +++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 27036ca0..4191a21e 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -128,8 +128,9 @@ var rootCmd = &cobra.Command{ } } if !allowCmdWithJWTV1Store { - return fmt.Errorf(`this version of nsc only supports jwtV2. To upgrade the v1 store %#q - type "%s upgrade-jwt"`, - store.GetName(), os.Args[0]) + return fmt.Errorf(`this version of nsc only supports jwtV2. To upgrade the v1 store %#q - type "%s upgrade-jwt". `+ + `Alternatively you can downgrade %s to a compatible version using: "%s update -version 0.5.0"\n`, + store.GetName(), os.Args[0], os.Args[0], os.Args[0]) } } } diff --git a/cmd/upgradejwt.go b/cmd/upgradejwt.go index b623737c..61e63764 100644 --- a/cmd/upgradejwt.go +++ b/cmd/upgradejwt.go @@ -84,8 +84,7 @@ func upgradeOperator(cmd *cobra.Command, s *store.Store, rep *store.Report) { } if s.IsManaged() { cmd.Print(cliprompts.WrapString(80, upgradeQuestion)) - rep.AddError(`No change was made! -Your store is in managed mode and was set up using: + rep.AddError(`No change was made! Your store is in managed mode and was set up using: "nsc add operator --force --url "" You need to contact "%s", obtain a V2 jwt and re issue the above command.`, opName) return @@ -128,13 +127,13 @@ This backup does `+cliprompts.Bold("not contain private nkeys")+`! Delete the directory "%s" Extract the backup Move the created directory in place of the deleted one - Downgrade nsc using: "nsc update -version " + Downgrade nsc using: "nsc update -version 0.5.0" `, backupFile, s.Dir)) } cmd.Print(cliprompts.WrapString(80, `In order to use jwt V2, `+cliprompts.Bold("you must upgrade all nats-server")+` prior to usage! If you are `+cliprompts.Bold("not ready")+` to switch over to jwt V2, downgrade nsc using: -"nsc update -version " +"nsc update -version 0.5.0" `)) if conv, _ := cliprompts.Confirm(cliprompts.WrapString(80, upgradeQuestion), false); !conv { rep.AddOK("Declined to convert at this time. Rerun command when ready.")