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

Set different retry periods for CRDs #579

Merged
merged 1 commit into from
Feb 22, 2024
Merged
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
7 changes: 6 additions & 1 deletion apiextensions/v1/crd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ package v1

import (
"context"
"time"

"github.com/pkg/errors"
api "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
Expand All @@ -29,6 +30,10 @@ import (
kutil "kmodules.xyz/client-go"
)

const (
RetryTimeout = 10 * time.Minute
)

func CreateOrUpdateCustomResourceDefinition(
ctx context.Context,
c cs.Interface,
Expand Down Expand Up @@ -70,7 +75,7 @@ func TryUpdateCustomResourceDefinition(
opts metav1.UpdateOptions,
) (result *api.CustomResourceDefinition, err error) {
attempt := 0
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, kutil.RetryTimeout, true, func(ctx context.Context) (bool, error) {
err = wait.PollUntilContextTimeout(ctx, kutil.RetryInterval, RetryTimeout, true, func(ctx context.Context) (bool, error) {
attempt++
cur, e2 := c.ApiextensionsV1().CustomResourceDefinitions().Get(ctx, name, metav1.GetOptions{})
if kerr.IsNotFound(e2) {
Expand Down
Loading