-
Notifications
You must be signed in to change notification settings - Fork 263
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
Adding retry loop to update #1441
Conversation
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.
@vyasgun: 0 warnings.
In response to this:
Description
Added retry loop from client go to service update command.
Changes
- Added retry loop from client go to service update command.
Reference
Fixes #1102
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
Codecov Report
@@ Coverage Diff @@
## main #1441 +/- ##
==========================================
+ Coverage 78.70% 78.98% +0.27%
==========================================
Files 162 162
Lines 8368 8416 +48
==========================================
+ Hits 6586 6647 +61
+ Misses 1098 1088 -10
+ Partials 684 681 -3
Continue to review full report at Codecov.
|
/retest |
1 similar comment
/retest |
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.
Looks good to me, thanks @vyasgun for jumping on this.
I have some proposals and questions as comments, but I think we are then still missing a bunch of update operations.
ls docs/cmd/*update* | cat -
docs/cmd/kn_domain_update.md
docs/cmd/kn_service_update.md
docs/cmd/kn_source_apiserver_update.md
docs/cmd/kn_source_binding_update.md
docs/cmd/kn_source_container_update.md
docs/cmd/kn_source_ping_update.md
docs/cmd/kn_subscription_update.md
docs/cmd/kn_trigger_update.md
Also, I would change our own update mechanism in kn service update
to reuse the tool-based version.
Finally, don't forget to update the CHANGELOG ;-)
@@ -19,10 +19,14 @@ import ( | |||
"fmt" | |||
|
|||
"github.com/spf13/cobra" | |||
"k8s.io/client-go/util/retry" | |||
"knative.dev/client/pkg/kn/commands/service" |
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.
Why do you need this dependency ? Normally commands should stay independent and don't refer to each other to avoid cyclic dependency and allow them easily to be refactored/moved.
If there is some code that can be reused, I'd propose to move it to a shared package and use it from there in service and here.
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.
This is because I imported the MaxUpdateRetries from service package. I will change this and create a variable in the same package.
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.
Thanks !
@vyasgun is the PR complete? Or are you still looking into some leftover update functions to add retry loop? |
@dsimansk I pushed a few more commits. It's done now and once reviewed we can merge. |
There's one more comment, but that's not super important. In addition there're several codecov warnings, but those can be addressed as part of improving coverage story. IMO it looks very good, nice work! @rhuss if you can make another please. |
not sure that I can make it today, but will review it early (European) morning at last. |
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.
Thanks a lot. I have a minor suggestion to simplify the call to a function (avoiding one unnecessary inner function) and some other minor comments.
Overall looks very good and I think we are close to merge it.
newTrigger := a.(client_testing.UpdateAction).GetObject() | ||
name := newTrigger.(metav1.Object).GetName() | ||
|
||
if name == "testTrigger" && attemptCount > 0 { |
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.
very nice test for checking the retry.
The following is the coverage report on the affected files.
|
thanks a lot ! /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rhuss, vyasgun The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Description
Added retry loop from client go to service and source update commands.
Changes
Reference
Fixes #1102