Repository: nats-io/nsc (go)

Issue:
Wrong output in `nsc reissue operator`
### What version were you using?

nsc version 2.8.0
nats-server version 2.9.22


### What environment was the server running in?

Linux VM, arm64, docker images:

- nats:2.9.22-scratch
- natsio/nats-box:0.13.9

### Is this defect reproducible?

1. Run `nsc reissue operator --convert-to-signing-key`

### Given the capability you are leveraging, describe your expectation?

The output should show the old key being turned into a signing key
```
[ OK ] operator "O" successfully changed identity to: {new_key}
[ OK ] old operator key "{old_key}" turned into signing key
```

### Given the expectation, what is the defect you are observing?

The output shows the new key as the old operator key:
```
$ nsc reissue operator --convert-to-signing-key
[ OK ] operator "O" successfully changed identity to: OBUGUUS5PYPNSNXCZ6TYAHYYKW5L2CH3XXTZW5IJPVCCR4CORRONC7JH
[ OK ] old operator key "OBUGUUS5PYPNSNXCZ6TYAHYYKW5L2CH3XXTZW5IJPVCCR4CORRONC7JH" turned into signing key
all jobs succeeded
```

Pull request description:
Fixed output of nsc reissue operator --convert-to-signing-key
Fixes #609 

Patch:
diff --git a/cmd/reissueoperator.go b/cmd/reissueoperator.go
index eb65f2e..1a6722b 100644
--- a/cmd/reissueoperator.go
+++ b/cmd/reissueoperator.go
@@ -149,7 +149,7 @@ func (p *reIssueOperator) Run(ctx ActionCtx) (store.Status, error) {
 	}
 	r.AddOK("operator %q successfully changed identity to: %s", op.Name, opPub)
 	if p.turnIntoSigningKey {
-		r.AddOK("old operator key %q turned into signing key", opPub)
+		r.AddOK("old operator key %q turned into signing key", oldPubKey)
 		return r, nil
 	}
 	accounts, err := s.ListSubContainers(store.Accounts)


Test patch:
diff --git a/cmd/reissueoperator_test.go b/cmd/reissueoperator_test.go
index e495736..c3d9efb 100644
--- a/cmd/reissueoperator_test.go
+++ b/cmd/reissueoperator_test.go
@@ -35,11 +35,18 @@ func Test_ReIssue(t *testing.T) {
 	// add testing account
 	ts.AddAccount(t, "A")
 
-	_, _, err = ExecuteCmd(createReIssueOperatorCmd(), "--convert-to-signing-key")
+	_, stderr, err := ExecuteCmd(createReIssueOperatorCmd(), "--convert-to-signing-key")
 	require.NoError(t, err)
 	op3, err := ts.Store.ReadOperatorClaim()
 	require.NoError(t, err)
 	require.NotEqual(t, op2.Subject, op3.Subject)
+	require.Equal(
+		t,
+		stderr,
+		"[ OK ] operator \"O\" successfully changed identity to: "+op3.Subject+"\n"+
+			"[ OK ] old operator key \""+op2.Subject+"\" turned into signing key\n"+
+			"all jobs succeeded\n",
+	)
 	require.Len(t, op3.SigningKeys, 1)
 	require.True(t, op3.SigningKeys.Contains(op2.Subject))