-
Notifications
You must be signed in to change notification settings - Fork 81
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
feat: allow not waiting for actions #843
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #843 +/- ##
==========================================
- Coverage 61.43% 61.35% -0.08%
==========================================
Files 237 237
Lines 8494 8505 +11
==========================================
Hits 5218 5218
- Misses 2567 2578 +11
Partials 709 709 ☔ View full report in Codecov by Sentry. |
@@ -14,7 +14,7 @@ import ( | |||
) | |||
|
|||
func (c *state) WaitForActions(cmd *cobra.Command, ctx context.Context, actions ...*hcloud.Action) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have "composite" commands in the CLI, where we wait for some actions and then make more API calls? These could fail if we do not wait for the initial actions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, for example when enabling protection after resource creation. How about we add a function like MustWaitForActions
which doesn't include the wait
option logic and then make WaitForActions
a wrapper of that?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds fine to me.
We should also look at these cases and decide if its really necessary to wait for the running actions or the next call is independent and can still be made. (ie. is it necessary for the server to start before enabling the protection?)
Since the scope of this PR is bigger than expected, I will close it for now. We plan to revisit this idea later. |
This PR adds the
no-wait
option, which allows to skip waiting for actions.Closes #833
Related to #613, #489, #284