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

platform environment:resume returns an error if the project is not paused #1332

Open
rfay opened this issue Sep 30, 2023 · 1 comment
Open

Comments

@rfay
Copy link
Contributor

rfay commented Sep 30, 2023

platform environment:resume returns an error if the project is not paused.

It doesn't seem like this should be an error. How about a success return value?

$ platform environment:resume --project="${PLATFORM_PROJECT}" --environment="${PLATFORM_ENVIRONMENT}" --yes
The environment platform-pull (type: staging) is not paused. Only paused environments can be resumed.
l$ echo $?
1
Platform.sh CLI 4.10.2
@pjcdawkins
Copy link
Collaborator

pjcdawkins commented Nov 30, 2023

I guess the status not being "paused" doesn't necessarily mean that it is active or has been successfully resumed - because there is an in-between status of "dirty" while an environment might be either on the way to being paused, or on the way to being resumed. And there are also the statuses of "inactive" and "deleting" which would also not be desired results of resuming. So I feel returning an error feels more conservative: it's up to the caller then to check the exact environment state. I suppose we could return 0 if the environment is active, and 1 otherwise? but that seems convoluted.

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

No branches or pull requests

2 participants