Skip to content

Commit

Permalink
Remove WithLazyDiscovery, WithLimiter options from apiutil.NewDynamic…
Browse files Browse the repository at this point in the history
  • Loading branch information
ary1992 committed Jun 23, 2023
1 parent 2dfb839 commit 6c6f4ac
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 7 deletions.
3 changes: 0 additions & 3 deletions cmd/gardener-resource-manager/app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/go-logr/logr"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"golang.org/x/time/rate"
corev1 "k8s.io/api/core/v1"
eventsv1 "k8s.io/api/events/v1"
eventsv1beta1 "k8s.io/api/events/v1beta1"
Expand Down Expand Up @@ -210,8 +209,6 @@ func run(ctx context.Context, log logr.Logger, cfg *config.ResourceManagerConfig
return apiutil.NewDynamicRESTMapper(
config,
httpClient,
apiutil.WithLazyDiscovery,
apiutil.WithLimiter(rate.NewLimiter(rate.Every(1*time.Minute), 1)), // rediscover at maximum every minute
)
}

Expand Down
2 changes: 1 addition & 1 deletion extensions/pkg/util/shoot_clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func NewClientForShoot(ctx context.Context, c client.Client, namespace string, o
return nil, nil, fmt.Errorf("failed to get HTTP client for config: %w", err)
}

mapper, err := apiutil.NewDynamicRESTMapper(shootRESTConfig, httpClient, apiutil.WithLazyDiscovery)
mapper, err := apiutil.NewDynamicRESTMapper(shootRESTConfig, httpClient)
if err != nil {
return nil, nil, fmt.Errorf("failed to create new DynamicRESTMapper: %w", err)
}
Expand Down
3 changes: 0 additions & 3 deletions pkg/client/kubernetes/runtime_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import (
"time"

"github.com/go-logr/logr"
"golang.org/x/time/rate"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/rest"
Expand Down Expand Up @@ -65,8 +64,6 @@ func setClientOptionsDefaults(config *rest.Config, options *client.Options) erro
mapper, err := apiutil.NewDynamicRESTMapper(
config,
httpClient,
apiutil.WithLazyDiscovery,
apiutil.WithLimiter(rate.NewLimiter(rate.Every(5*time.Second), 1)),
)
if err != nil {
return fmt.Errorf("failed to create new DynamicRESTMapper: %w", err)
Expand Down

0 comments on commit 6c6f4ac

Please sign in to comment.