Refactor/e2e waiter package#526
Merged
oleg-kushniriov merged 6 commits intoApr 19, 2026
Merged
Conversation
7f74579 to
ecf5b0c
Compare
danbar2
reviewed
Apr 16, 2026
danbar2
reviewed
Apr 16, 2026
e119051 to
81b6ede
Compare
shayasoolin
reviewed
Apr 19, 2026
shayasoolin
reviewed
Apr 19, 2026
shayasoolin
approved these changes
Apr 19, 2026
danbar2
approved these changes
Apr 19, 2026
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.
What type of PR is this?
/kind feature
/kind cleanup
What this PR does / why we need it:
Creates a dedicated e2e/waiter package that provides a single, generic Waiter[T] struct driven by user-supplied fetch functions and predicates. This replaces the scattered wait/poll
logic that was previously spread across k8s.PollForCondition, manager methods, and inline closures with inconsistent signatures.
Key changes:
Waiter[T]struct with builder-pattern configuration (New[T]().WithTimeout().WithInterval().WithLogger().WithRetryOnError()), WaitFor (returns value) andWaitUntil (discards value) methods, typed
FetchFunc[T]/Predicate[T]types, built-in predicates (IsNotZero, IsZero, AlwaysTrue), helper converters (ToFetchFunc1,ToFetchFunc2,FetchByName), and resource lifecycle helpers (
WaitForResource,WaitForResourceDeletion)AllReady,AllPending,MatchPhases,ReadyCount,CountEquals,ExcludesPod,HasUnschedulableEventsWhich issue(s) this PR fixes:
Fixes #518
Special notes for your reviewer:
pattern where callers declared var result T outside PollForCondition and assigned it inside.
any] methods.
fail immediately.
Does this PR introduce a API change?
NONE
Additional documentation e.g., enhancement proposals, usage docs, etc.:
See
e2e/waiter/waiter.gofor the full API. Usage example: