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

Fix Various Deprecation Warnings #3453

Merged
merged 8 commits into from
Oct 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkg/gameserverallocations/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -692,8 +692,7 @@ func Retry(backoff wait.Backoff, fn func() error) error {
return false, nil
}
})
// nolint:staticcheck
if err == wait.ErrWaitTimeout {
if wait.Interrupted(err) {
err = lastConflictErr
}
return err
Expand Down
8 changes: 3 additions & 5 deletions test/e2e/framework/framework.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,7 @@ func (f *Framework) WaitForGameServerState(t *testing.T, gs *agonesv1.GameServer
// Each Allocated GameServer gets deleted allocDuration after it was Allocated.
// GameServers will continue to be Allocated until a message is passed to the done channel.
func (f *Framework) CycleAllocations(ctx context.Context, t *testing.T, flt *agonesv1.Fleet, period time.Duration, allocDuration time.Duration) {
// nolint:staticcheck
err := wait.PollImmediateUntil(period, func() (bool, error) {
err := wait.PollUntilContextCancel(ctx, period, true, func(ctx context.Context) (bool, error) {
gsa := GetAllocation(flt)
gsa, err := f.AgonesClient.AllocationV1().GameServerAllocations(flt.Namespace).Create(context.Background(), gsa, metav1.CreateOptions{})
if err != nil || gsa.Status.State != allocationv1.GameServerAllocationAllocated {
Expand All @@ -309,10 +308,9 @@ func (f *Framework) CycleAllocations(ctx context.Context, t *testing.T, flt *ago
}(gsa)

return false, nil
}, ctx.Done())
})
// Ignore wait timeout error, will always be returned when the context is cancelled at the end of the test.
// nolint:staticcheck
if err != wait.ErrWaitTimeout {
if !wait.Interrupted(err) {
require.NoError(t, err)
}
}
Expand Down
3 changes: 1 addition & 2 deletions vendor/k8s.io/client-go/util/retry/util.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.