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

[Bug]: step context list should print an error to stderr and exit 1 if there are no contexts present #879

Open
jdoss opened this issue Mar 12, 2023 · 1 comment
Labels
bug needs triage Waiting for discussion / prioritization by team
Milestone

Comments

@jdoss
Copy link

jdoss commented Mar 12, 2023

Steps to Reproduce

I am looking for a way to tell if STEPPATH is using contexts or not.

$ export STEPPATH=/tmp/tmpsteppath
$ step ca bootstrap --ca-url https://my.cool.ca.smallstep.com --fingerprint myfingerprint 
$ step context list
$ echo $?
0

If STEPPATH is not using a context step context list should output that there are no contexts present to stderr and exit 1

Your Environment

Fedora Linux 37

$ step version
Smallstep CLI/0.23.4 (linux/amd64)

Expected Behavior

$ export STEPPATH=/tmp/tmpsteppath
$ step ca bootstrap --ca-url https://my.cool.ca.smallstep.com --fingerprint myfingerprint 
$ step context list
Error: There are no contexts to list
$ echo $?
1

Actual Behavior

$ export STEPPATH=/tmp/tmpsteppath
$ step ca bootstrap --ca-url https://my.cool.ca.smallstep.com --fingerprint myfingerprint 
$ step context list
$ echo $?
0

Additional Context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@jdoss jdoss added bug needs triage Waiting for discussion / prioritization by team labels Mar 12, 2023
@jdoss
Copy link
Author

jdoss commented Mar 12, 2023

I guess one can use step context current to test if the STEPPATH is using a context but I think should we add the same behavior to step context list

$ step context current
no context selected
$ echo $?
1

@dopey dopey added this to the v0.24.0 milestone Mar 15, 2023
@maraino maraino modified the milestones: v0.24.0, v0.24.1 Apr 12, 2023
@maraino maraino modified the milestones: v0.24.4, v0.24.5 Jul 18, 2023
@maraino maraino modified the milestones: v0.25.0, v0.25.1 Sep 27, 2023
@hslatman hslatman modified the milestones: v0.25.1, v0.25.2 Nov 29, 2023
@hslatman hslatman modified the milestones: v0.25.2, v0.25.3 Feb 20, 2024
@hslatman hslatman modified the milestones: v0.26.0, v0.26.1 Mar 29, 2024
@hslatman hslatman modified the milestones: v0.26.1, v0.26.2 Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs triage Waiting for discussion / prioritization by team
Projects
None yet
Development

No branches or pull requests

4 participants