-
Notifications
You must be signed in to change notification settings - Fork 104
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
Add the --wait flag to install #966
Add the --wait flag to install #966
Conversation
cc @gerred |
pkg/kudoctl/cmd/install/install.go
Outdated
return errors.Wrap(err, "getting plan status") | ||
} | ||
if status.Pending { | ||
time.Sleep(2 * time.Second) |
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.
couple notes over this block:
I would consider replacing this with a for + select, and have a few channels you're selecting on. This will enable you to add timeouts in a nice, clean way. Eventually we might want to move this out to some Waiter package/func/interface as well.
Also, I'd think we'd want some sort of timeout, even if it's high (10 minutes?).
Check out the select block here to see a bit of what I mean on that:
https://gobyexample.com/timeouts
Where this gets interesting (and maybe we pair on Monday) is you'd need some sort of goroutine-based retry for actually fetching the planStatus.
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.
actually, nevermind, this handles the client in the way we want it to. So we may just want to separate out the display and the logic into two separate functions. If you want to try your hand at that...that'd be a great next step before we do any refactoring into channel-based logic.
Hey @anthonydahanne following up on this. :) Can I help you in any way? |
@anthonydahanne could you rebase or merge latest master into this please? I'll work with you to get this merge in when we get on the latest. Thanks!! |
5571bec
to
bd21ba2
Compare
hello @kensipe: tried to rebase with my conference fried brain, so, yeah, not super confident. Since I submitted, a new Once again, maybe I don't make sense, I haven't even tested locally since I could not find quickly the instructions to rebuild and run Kudo... |
Hey @anthonydahanne - great seeing you at KubeCon. Want to pair to finish and merge this? |
ping @anthonydahanne any interest in pairing or finishing this? |
hey there! sorry for late reply! |
sweet! |
all fine now!
|
It's not necessary to rely on
|
* get the status of the current plan, until it is completed then return Signed-off-by: Anthony Dahanne <anthony.dahanne@gmail.com>
bd21ba2
to
60b2e09
Compare
@@ -63,6 +64,26 @@ func InstallPackage(kc *Client, resources *packages.Resources, skipInstance bool | |||
if _, err := kc.InstallInstanceObjToCluster(resources.Instance, namespace); err != nil { |
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.
I think I would rather the logic for this "wait" to be included in the client so that people using the client to install can leverage this. Eventually we would have the update call also have a "wait" option
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.
I had to add my own "wait" function in the TF provider since there wasn't one in the client. Adding this wait like you've done won't let me eliminate the wait I have:
This can be tough on a new community contribution but there has been some evolution of thought here which sets a new acceptance criteria. I am willing to merge this as a good starting point and thank you for the contribution! Or we can see the full impl on this PR. Here is what we are looking to do with this:
To narrow the scope... we are not looking for wait to work with upgrade and update... just that the solution should have that in mind and provide a solution that can be leveraged. |
The assign at this point (to me) is as a shepard to @anthonydahanne |
The plan for this now after talking with anthony is to merge this in (with the value it brings) and take ownership of the new scope listed ^^. I want to hold until after the 0.11.0 release which is scheduled for tomorrow. |
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.
lgtm for the initial commit. Follow on work has been identified in Issue #1418
What this PR does / why we need it:
Attempt to solve #964
Fixes #964