From 999b40f13bbf9ea98a6acbbf82bfbc1a8fbbb739 Mon Sep 17 00:00:00 2001 From: Andy Goldstein Date: Fri, 21 Apr 2023 12:00:05 -0400 Subject: [PATCH] Fix deprecated sets.String usage Signed-off-by: Andy Goldstein --- cmd/apigen/main.go | 2 +- pkg/cache/client/round_tripper.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cmd/apigen/main.go b/cmd/apigen/main.go index bf2d5070012..779c19a8aeb 100644 --- a/cmd/apigen/main.go +++ b/cmd/apigen/main.go @@ -370,7 +370,7 @@ func writeObjects(logger logr.Logger, outputDir string, exports []*apisv1alpha1. } encoder := codecs.EncoderForVersion(info.Serializer, apisv1alpha1.SchemeGroupVersion) - writtenExports := sets.String{} + writtenExports := sets.New[string]() for _, export := range exports { out, err := runtime.Encode(encoder, export) if err != nil { diff --git a/pkg/cache/client/round_tripper.go b/pkg/cache/client/round_tripper.go index 0f17f913c22..dbe6a164f89 100644 --- a/pkg/cache/client/round_tripper.go +++ b/pkg/cache/client/round_tripper.go @@ -167,8 +167,8 @@ func NewShardNameFromObjectRoundTripper(delegate http.RoundTripper, requestInfoR return &ShardNameFromObjectRoundTripper{ delegate: delegate, requestInfoResolver: requestInfoResolver, - supportedResources: sets.NewString(supportedResources...), - supportedVerbs: sets.NewString("create", "update", "patch"), + supportedResources: sets.New[string](supportedResources...), + supportedVerbs: sets.New[string]("create", "update", "patch"), } } @@ -178,8 +178,8 @@ func NewShardNameFromObjectRoundTripper(delegate http.RoundTripper, requestInfoR type ShardNameFromObjectRoundTripper struct { delegate http.RoundTripper requestInfoResolver func(*http.Request) (string, string, error) /*res, verb, err*/ - supportedResources sets.String - supportedVerbs sets.String + supportedResources sets.Set[string] + supportedVerbs sets.Set[string] } func (c *ShardNameFromObjectRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) {