Skip to content

Commit

Permalink
Replace deprecated sets usages with generic version (#1182)
Browse files Browse the repository at this point in the history
* Replace deprecated sets usages with generic version

* Run `hack/update-deps.sh`
  • Loading branch information
ReToCode authored Jan 10, 2024
1 parent 85807de commit 3f155cc
Show file tree
Hide file tree
Showing 336 changed files with 22,695 additions and 8,904 deletions.
44 changes: 22 additions & 22 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ require (
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/pires/go-proxyproto v0.6.1
go.uber.org/zap v1.26.0
google.golang.org/genproto/googleapis/rpc v0.0.0-20231127180814-3a041ad873d4
google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0
google.golang.org/grpc v1.60.1
google.golang.org/protobuf v1.31.0
google.golang.org/protobuf v1.32.0
gotest.tools/v3 v3.0.3
k8s.io/api v0.27.6
k8s.io/apimachinery v0.27.6
k8s.io/client-go v0.27.6
k8s.io/code-generator v0.27.6
knative.dev/hack v0.0.0-20231201014241-7030d5bf584d
knative.dev/networking v0.0.0-20231219131858-8c7897c8b9a0
knative.dev/pkg v0.0.0-20231219072704-d513e487961e
k8s.io/api v0.28.5
k8s.io/apimachinery v0.28.5
k8s.io/client-go v0.28.5
k8s.io/code-generator v0.28.5
knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7
knative.dev/networking v0.0.0-20240109202710-07c412e16861
knative.dev/pkg v0.0.0-20240109155808-21d8c37af23f
)

require (
Expand All @@ -44,12 +44,12 @@ require (
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/jsonreference v0.20.2 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gogo/googleapis v1.4.1 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/google/gnostic v0.5.7-v3refs // indirect
github.com/google/gnostic-models v0.6.8 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/gorilla/websocket v1.5.1 // indirect
github.com/grpc-ecosystem/grpc-gateway/v2 v2.11.3 // indirect
Expand All @@ -64,10 +64,10 @@ require (
github.com/opentracing/opentracing-go v1.2.0 // indirect
github.com/openzipkin/zipkin-go v0.4.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect
github.com/prometheus/client_golang v1.18.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.11.1 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/statsd_exporter v0.22.7 // indirect
github.com/rs/dnscache v0.0.0-20211102005908-e0241e321417 // indirect
github.com/spf13/pflag v1.0.5 // indirect
Expand All @@ -80,25 +80,25 @@ require (
golang.org/x/mod v0.14.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sync v0.6.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/term v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.16.1 // indirect
gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect
google.golang.org/api v0.154.0 // indirect
google.golang.org/api v0.155.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect
google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231211222908-989df2bf70f3 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.27.6 // indirect
k8s.io/apiextensions-apiserver v0.28.5 // indirect
k8s.io/gengo v0.0.0-20221011193443-fad74ee6edd9 // indirect
k8s.io/klog/v2 v2.90.1 // indirect
k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f // indirect
k8s.io/utils v0.0.0-20230209194617-a36077c30491 // indirect
k8s.io/klog/v2 v2.100.1 // indirect
k8s.io/kube-openapi v0.0.0-20230717233707-2695361300d9 // indirect
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 // indirect
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
sigs.k8s.io/structured-merge-diff/v4 v4.2.3 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
Expand Down
95 changes: 45 additions & 50 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/config/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ type Kourier struct {
// TLS handshake. The default value is "false".
EnableCryptoMB bool
// CipherSuites specifies the cipher suites for TLS external listener.
CipherSuites sets.String
CipherSuites sets.Set[string]
// Tracing specifies the configuration for gateway tracing
Tracing Tracing
}
2 changes: 1 addition & 1 deletion pkg/config/configmap_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestKourierConfig(t *testing.T) {
name: "set cipher suites",
want: &Kourier{
EnableServiceAccessLogging: false,
CipherSuites: sets.NewString("foo", "bar"),
CipherSuites: sets.New("foo", "bar"),
},
data: map[string]string{
enableServiceAccessLoggingKey: "false",
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/zz_generated.deepcopy.go

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

3 changes: 2 additions & 1 deletion pkg/envoy/api/listener.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import (
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/types/known/durationpb"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/sets"

"knative.dev/net-kourier/pkg/config"
)
Expand Down Expand Up @@ -203,7 +204,7 @@ func createFilterChainsForTLS(manager *hcm.HttpConnectionManager, sniMatches []*
return nil, err
}

c := Certificate{Certificate: sniMatch.CertificateChain, PrivateKey: sniMatch.PrivateKey, CipherSuites: kourierConfig.CipherSuites.List()}
c := Certificate{Certificate: sniMatch.CertificateChain, PrivateKey: sniMatch.PrivateKey, CipherSuites: sets.List(kourierConfig.CipherSuites)}

tlsContext, err := c.createTLSContext()
if err != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/envoy/api/listener_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func TestNewHTTPSListenerWithSNIWithCipherSuites(t *testing.T) {
EnableServiceAccessLogging: true,
EnableProxyProtocol: false,
IdleTimeout: 0 * time.Second,
CipherSuites: sets.NewString("foo", "bar"),
CipherSuites: sets.New("foo", "bar"),
}
manager := NewHTTPConnectionManager("test", &kourierConfig)
listener, err := NewHTTPSListenerWithSNI(manager, 8443, sniMatches, &kourierConfig)
Expand All @@ -184,7 +184,7 @@ func TestNewHTTPSListenerWithSNIWithCipherSuites(t *testing.T) {
err = anypb.UnmarshalTo(listener.FilterChains[0].GetTransportSocket().GetTypedConfig(), downstreamTLSContext, proto.UnmarshalOptions{})
assert.NilError(t, err)

assert.DeepEqual(t, kourierConfig.CipherSuites.List(), downstreamTLSContext.CommonTlsContext.TlsParams.CipherSuites)
assert.DeepEqual(t, sets.List(kourierConfig.CipherSuites), downstreamTLSContext.CommonTlsContext.TlsParams.CipherSuites)

assert.Equal(t, core.SocketAddress_TCP, listener.Address.GetSocketAddress().Protocol)
assert.Equal(t, "0.0.0.0", listener.Address.GetSocketAddress().Address)
Expand Down
4 changes: 2 additions & 2 deletions pkg/generator/caches.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func newExternalEnvoyListenerWithOneCertFilterChain(ctx context.Context, manager
Certificate: certificateChain,
PrivateKey: privateKey,
PrivateKeyProvider: privateKeyProvider(cfg.EnableCryptoMB),
CipherSuites: cfg.CipherSuites.List(),
CipherSuites: sets.List(cfg.CipherSuites),
})
}

Expand All @@ -466,7 +466,7 @@ func newLocalEnvoyListenerWithOneCertFilterChain(ctx context.Context, manager *h
Certificate: certificateChain,
PrivateKey: privateKey,
PrivateKeyProvider: privateKeyProvider(cfg.EnableCryptoMB),
CipherSuites: cfg.CipherSuites.List(),
CipherSuites: sets.List(cfg.CipherSuites),
})
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/reconciler/ingress/lister.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (l *gatewayPodTargetLister) ListProbeTargets(ctx context.Context, ing *v1al
}

func (l *gatewayPodTargetLister) getIngressUrls(ing *v1alpha1.Ingress, gatewayIps []string) ([]status.ProbeTarget, error) {
ips := sets.NewString(gatewayIps...)
ips := sets.New(gatewayIps...)

localIngressTLS := ing.GetIngressTLSForVisibility(v1alpha1.IngressVisibilityClusterLocal)
externalIngressTLS := ing.GetIngressTLSForVisibility(v1alpha1.IngressVisibilityExternalIP)
Expand Down
4 changes: 2 additions & 2 deletions test/ha/kourier_control_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func TestKourierControlHA(t *testing.T) {
}

// TODO(mattmoor): Once we switch to the new sharded leader election, we should use more than a single bucket here, but the test is still interesting.
leaders, err := pkgHa.WaitForNewLeaders(ctx, t, clients.KubeClient, kourierControlDeployment, kourierControlNamespace, sets.NewString(), 1 /* numBuckets */)
leaders, err := pkgHa.WaitForNewLeaders(ctx, t, clients.KubeClient, kourierControlDeployment, kourierControlNamespace, sets.New[string](), 1 /* numBuckets */)
if err != nil {
t.Fatalf("Failed to get leader: %v", err)
}
Expand All @@ -65,7 +65,7 @@ func TestKourierControlHA(t *testing.T) {
prober := test.RunRouteProber(t.Logf, clients, url.URL())
defer test.AssertProberDefault(t, prober)

for _, leader := range leaders.List() {
for _, leader := range sets.List(leaders) {
if err := clients.KubeClient.CoreV1().Pods(kourierControlNamespace).Delete(ctx, leader, metav1.DeleteOptions{
GracePeriodSeconds: ptr.Int64(0),
}); err != nil && !apierrs.IsNotFound(err) {
Expand Down

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

File renamed without changes.

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

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

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

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

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

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

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

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

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

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

Loading

0 comments on commit 3f155cc

Please sign in to comment.