Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Context's command for switching to previous (old) nats context #889

Merged
merged 4 commits into from
Oct 3, 2023

Conversation

boris-ilijic
Copy link
Contributor

New nats context subcommand that allows cd - or git checkout - type of operation but for NATS context.
This PR implements the logic for switching to the previous (old) nats context using:

  • nats ctx previous
  • nats ctx -- - (unfortunately wasn't able to make nats ctx - to work)

Example:

$ nats ctx select local-sys                                                                                                                                       
NATS Configuration Context "local-sys"

  Description: localhost sys
  Server URLs: nats://127.0.0.1:4222
     Username: admin
     Password: ********
         Path: /Users/boris/.config/nats/context/local-sys.json

$ nats ctx -- -                                                                                                                                         
NATS Configuration Context "local"

   Description: Localhost
   Server URLs: nats://127.0.0.1:4222
      Username: ruser
      Password: *********
          Path: /Users/boris/.config/nats/context/local.json
  Color Scheme: yellow

$ nats ctx -- -                                                                                                                                               
NATS Configuration Context "local-sys"

  Description: localhost sys
  Server URLs: nats://127.0.0.1:4222
     Username: admin
     Password: ********
         Path: /Users/boris/.config/nats/context/local-sys.json

This PR is still not ready and requires:

@ripienaar
Copy link
Collaborator

For the breaking change maye wait for https://github.com/nats-io/natscli/pull/890/files to land then rebase yours ontop.

The missing field was a left over from the beta phases that didnt make it to release so has to go.

@boris-ilijic
Copy link
Contributor Author

Thanks for info, I'll wait for that PR.
Keep in mind that nats-io/jsm.go#485 needs to be merged also to completely finalize this one.

@boris-ilijic
Copy link
Contributor Author

PR is ready

@ripienaar ripienaar merged commit 59cff75 into nats-io:main Oct 3, 2023
2 checks passed
@ripienaar
Copy link
Collaborator

Nice one thank you!

@boris-ilijic boris-ilijic deleted the old-ctx branch October 3, 2023 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants