Skip to content

Commit

Permalink
Changed version numbers and descriptions for jwt update scenarios
Browse files Browse the repository at this point in the history
Signed-off-by: Matthias Hanel <mh@synadia.com>
  • Loading branch information
matthiashanel committed Mar 17, 2021
1 parent 99e560e commit 58ead2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
}
}
}
Expand Down
7 changes: 3 additions & 4 deletions cmd/upgradejwt.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 <file or url>""
You need to contact "%s", obtain a V2 jwt and re issue the above command.`, opName)
return
Expand Down Expand Up @@ -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 <previous release>"
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 <previous release>"
"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.")
Expand Down

0 comments on commit 58ead2a

Please sign in to comment.