[Issue-278] Waiter uses watchTools.UntilWithSync instead of Until to handle resource version old error#359
Merged
tomkennedy513 merged 1 commit intomainfrom Dec 20, 2023
Conversation
…handle resource version old error Signed-off-by: Caroline Scherf <fcaroline@vmware.com>
fcaroline2020
commented
Sep 12, 2023
fcaroline2020
commented
Sep 12, 2023
Comment on lines
+129
to
+159
| it("recovers from too old resource version error", func() { | ||
| watcher.addEvent(watch.Event{ | ||
| Type: watch.Error, | ||
| Object: &v1.Status{ | ||
| TypeMeta: v1.TypeMeta{ | ||
| APIVersion: "v1", | ||
| Kind: "Status", | ||
| }, | ||
| Status: "Failure", | ||
| Message: "too old resource version: 23358 (23360)", | ||
| Reason: "Expired", | ||
| Code: 410, | ||
| }, | ||
| }) | ||
|
|
||
| builderObj := &v1alpha2.Builder{ | ||
| TypeMeta: resourceToWatch.TypeMeta, | ||
| ObjectMeta: resourceToWatch.ObjectMeta, | ||
| Status: v1alpha2.BuilderStatus{Status: conditionReady(corev1.ConditionTrue, generation)}, | ||
| } | ||
| content, err := runtime.DefaultUnstructuredConverter.ToUnstructured(builderObj) | ||
| if err != nil { | ||
| panic(err) | ||
| } | ||
| watcher.addEvent(watch.Event{ | ||
| Type: watch.Modified, | ||
| Object: &unstructured.Unstructured{Object: content}, | ||
| }) | ||
|
|
||
| require.NoError(t, waiter.Wait(context.Background(), resourceToWatch)) | ||
| }) |
Contributor
Author
There was a problem hiding this comment.
This test will fail with the cachetools.Until version with the error message that was first reported. Couldn't force the too old resource version error while testing locally in my cluster :(
tomkennedy513
approved these changes
Dec 20, 2023
neil-hickey
pushed a commit
to neil-hickey/kpack-cli
that referenced
this pull request
Jan 13, 2026
…/issue-278-import-cmd-retry [Issue-278] Waiter uses watchTools.UntilWithSync instead of Until to handle resource version old error
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #278