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

[Issue-278] Waiter uses watchTools.UntilWithSync instead of Until to handle resource version old error #359

Merged
merged 1 commit into from
Dec 20, 2023

Conversation

fcaroline2020
Copy link
Contributor

Resolves #278

…handle resource version old error

Signed-off-by: Caroline Scherf <[email protected]>
@fcaroline2020 fcaroline2020 requested a review from a team as a code owner September 12, 2023 11:13
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))
})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tomkennedy513 merged commit 8ed678c into main Dec 20, 2023
1 check passed
@tomkennedy513 tomkennedy513 deleted the issue-278-import-cmd-retry branch December 20, 2023 18:27
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

Successfully merging this pull request may close these issues.

KP Import command should be resilient to watcher errors and retry
2 participants