Skip to content

Commit

Permalink
Run hack/update-deps.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
ReToCode committed Jan 10, 2024
1 parent 77e2621 commit 06c1bab
Show file tree
Hide file tree
Showing 15 changed files with 38 additions and 41 deletions.
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,3 @@ require (
sigs.k8s.io/structured-merge-diff/v4 v4.3.0 // indirect
sigs.k8s.io/yaml v1.4.0 // indirect
)

replace knative.dev/networking => github.com/ReToCode/networking v0.0.0-20240109073627-bc010699726a
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/ReToCode/networking v0.0.0-20240109073627-bc010699726a h1:tNqizB6R53cc8/k0GmYQNh3qAvG7JGZXuUpD0Qc8cOQ=
github.com/ReToCode/networking v0.0.0-20240109073627-bc010699726a/go.mod h1:KL3tdfTQ58qOdE66WagSuFtppfMCNp+ZlDL3Oc6Bxno=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
Expand Down Expand Up @@ -698,6 +696,8 @@ k8s.io/utils v0.0.0-20230406110748-d93618cff8a2 h1:qY1Ad8PODbnymg2pRbkyMT/ylpTrC
k8s.io/utils v0.0.0-20230406110748-d93618cff8a2/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7 h1:mICurlRke2mlKP3LmyWYQYl6KZe80rYP5+ag9w2HQLA=
knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20240108134621-7cca4b010b25 h1:2H/mvXGSgfBcpNFUMWC3XCWL5zOrGGvas4RBbclEJ1M=
knative.dev/networking v0.0.0-20240108134621-7cca4b010b25/go.mod h1:ynNh7EoqxkST4jWPw6ZVyI9jwuF68WJNrX65yoAQ7FE=
knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9 h1:4nsTvrgApGtLTt6Gpo7ulJS03pBI+wSJ8+EOwVamDx0=
knative.dev/pkg v0.0.0-20240108152118-de3e9cc204c9/go.mod h1:YzKN/kzcJPhL+Z4fwuzbaiEnRLIbYvOiZUuCWFJ7PRA=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
)

var (
allowedAnnotations = sets.New[string](
allowedAnnotations = sets.NewString(
IngressClassAnnotationKey,
CertificateClassAnnotationKey,
DisableAutoTLSAnnotationKey,
Expand Down

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.

14 changes: 7 additions & 7 deletions vendor/knative.dev/networking/pkg/ingress/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ func InsertProbe(ing *v1alpha1.Ingress) (string, error) {

// HostsPerVisibility takes an Ingress and a map from visibility levels to a set of string keys,
// it then returns a map from that key space to the hosts under that visibility.
func HostsPerVisibility(ing *v1alpha1.Ingress, visibilityToKey map[v1alpha1.IngressVisibility]sets.Set[string]) map[string]sets.Set[string] {
output := make(map[string]sets.Set[string], 2) // We currently have public and internal.
func HostsPerVisibility(ing *v1alpha1.Ingress, visibilityToKey map[v1alpha1.IngressVisibility]sets.String) map[string]sets.String {
output := make(map[string]sets.String, 2) // We currently have public and internal.
for _, rule := range ing.Spec.Rules {
for host := range ExpandedHosts(sets.New(rule.Hosts...)) {
for host := range ExpandedHosts(sets.NewString(rule.Hosts...)) {
for key := range visibilityToKey[rule.Visibility] {
if _, ok := output[key]; !ok {
output[key] = make(sets.Set[string], len(rule.Hosts))
output[key] = make(sets.String, len(rule.Hosts))
}
output[key].Insert(host)
}
Expand All @@ -89,15 +89,15 @@ func HostsPerVisibility(ing *v1alpha1.Ingress, visibilityToKey map[v1alpha1.Ingr
}

// ExpandedHosts sets up hosts for the short-names for cluster DNS names.
func ExpandedHosts(hosts sets.Set[string]) sets.Set[string] {
func ExpandedHosts(hosts sets.String) sets.String {
allowedSuffixes := []string{
"",
"." + network.GetClusterDomainName(),
".svc." + network.GetClusterDomainName(),
}
// Optimistically pre-alloc.
expanded := make(sets.Set[string], len(hosts)*len(allowedSuffixes))
for _, h := range sets.List(hosts) {
expanded := make(sets.String, len(hosts)*len(allowedSuffixes))
for _, h := range hosts.List() {
for _, suffix := range allowedSuffixes {
if th := strings.TrimSuffix(h, suffix); suffix == "" || len(th) < len(h) {
if isValidTopLevelDomain(th) {
Expand Down
4 changes: 2 additions & 2 deletions vendor/knative.dev/networking/pkg/prober/prober.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,14 +143,14 @@ type Manager struct {

// mu guards keys.
mu sync.Mutex
keys sets.Set[string]
keys sets.String
}

// New creates a new Manager, that will invoke the given callback when
// async probing is finished.
func New(cb Done, transport http.RoundTripper) *Manager {
return &Manager{
keys: sets.New[string](),
keys: sets.NewString(),
cb: cb,
transport: transport,
}
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/networking/pkg/status/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ type workItem struct {

// ProbeTarget contains the URLs to probes for a set of Pod IPs serving out of the same port.
type ProbeTarget struct {
PodIPs sets.Set[string]
PodIPs sets.String
PodPort string
Port string
URLs []*url.URL
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ func TestGRPCSplit(t *testing.T) {
greenName, greenPort, _ := CreateGRPCService(ctx, t, clients, suffixGreen)

// The suffixes we expect to see.
want := sets.New(suffixBlue, suffixGreen)
want := sets.NewString(suffixBlue, suffixGreen)

// Create a simple Ingress over the Service.
name := test.ObjectNameForTest(t)
Expand Down Expand Up @@ -150,7 +150,7 @@ func TestGRPCSplit(t *testing.T) {
defer cancel()

const maxRequests = 100
got := sets.New[string]()
got := sets.NewString()
for i := 0; i < maxRequests; i++ {
stream, err := pc.PingStream(ctx)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ func TestPostSplitSetHeaders(t *testing.T) {
)

backends := make([]v1alpha1.IngressBackendSplit, 0, splits)
names := make(sets.Set[string], splits)
names := make(sets.String, splits)
for i := 0; i < splits; i++ {
name, port, _ := CreateRuntimeService(ctx, t, clients, networking.ServicePortNameHTTP1)
backends = append(backends, v1alpha1.IngressBackendSplit{
Expand Down Expand Up @@ -322,7 +322,7 @@ func TestPostSplitSetHeaders(t *testing.T) {
// Make enough requests that the likelihood of us seeing each variation is high,
// but don't check the distribution of requests, as that isn't the point of this
// particular test.
seen := make(sets.Set[string], len(names))
seen := make(sets.String, len(names))
for i := 0; i < maxRequests; i++ {
ri := RuntimeRequest(ctx, t, client, "http://"+name+".example.com")
if ri == nil {
Expand All @@ -345,7 +345,7 @@ func TestPostSplitSetHeaders(t *testing.T) {
// Make enough requests that the likelihood of us seeing each variation is high,
// but don't check the distribution of requests, as that isn't the point of this
// particular test.
seen := make(sets.Set[string], len(names))
seen := make(sets.String, len(names))
for i := 0; i < maxRequests; i++ {
ri := RuntimeRequest(ctx, t, client, "http://"+name+".example.com", func(req *http.Request) {
// Specify a value for the header to verify that implementations
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ func TestPathAndPercentageSplit(t *testing.T) {
totalHalf = total / 2
tolerance = total * 0.15
)
wantKeys := sets.New(fooName, barName)
wantKeys := sets.NewString(fooName, barName)
resultCh := make(chan string, total)

var g errgroup.Group
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1104,7 +1104,7 @@ type ResponseExpectation func(response *http.Response) error

func RuntimeRequest(ctx context.Context, t *testing.T, client *http.Client, url string, opts ...RequestOption) *types.RuntimeInfo {
return RuntimeRequestWithExpectations(ctx, t, client, url,
[]ResponseExpectation{StatusCodeExpectation(sets.New(http.StatusOK))},
[]ResponseExpectation{StatusCodeExpectation(sets.NewInt(http.StatusOK))},
false,
opts...)
}
Expand Down Expand Up @@ -1173,7 +1173,7 @@ func DumpResponse(_ context.Context, t *testing.T, resp *http.Response) {
t.Log(string(b))
}

func StatusCodeExpectation(statusCodes sets.Set[int]) ResponseExpectation {
func StatusCodeExpectation(statusCodes sets.Int) ResponseExpectation {
return func(response *http.Response) error {
if !statusCodes.Has(response.StatusCode) {
return fmt.Errorf("got unexpected status: %d, expected %v", response.StatusCode, statusCodes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func TestVisibility(t *testing.T) {

// Ensure the service is not publicly accessible
for _, privateHostName := range privateHostNames {
RuntimeRequestWithExpectations(ctx, t, client, "http://"+privateHostName, []ResponseExpectation{StatusCodeExpectation(sets.New(http.StatusNotFound))}, true)
RuntimeRequestWithExpectations(ctx, t, client, "http://"+privateHostName, []ResponseExpectation{StatusCodeExpectation(sets.NewInt(http.StatusNotFound))}, true)
}

for name := range privateHostNames {
Expand Down Expand Up @@ -165,7 +165,7 @@ func TestVisibilitySplit(t *testing.T) {
})

// Ensure we can't connect to the private resources
RuntimeRequestWithExpectations(ctx, t, client, "http://"+privateHostName, []ResponseExpectation{StatusCodeExpectation(sets.New(http.StatusNotFound))}, true)
RuntimeRequestWithExpectations(ctx, t, client, "http://"+privateHostName, []ResponseExpectation{StatusCodeExpectation(sets.NewInt(http.StatusNotFound))}, true)

loadbalancerAddress := localIngress.Status.PrivateLoadBalancer.Ingress[0].DomainInternal
proxyName, proxyPort, _ := CreateProxyService(ctx, t, clients, privateHostName, loadbalancerAddress)
Expand Down Expand Up @@ -328,7 +328,7 @@ func TestVisibilityPath(t *testing.T) {

// Ensure we can't connect to the private resources
for _, path := range []string{"", "/foo", "/bar", "/baz"} {
RuntimeRequestWithExpectations(ctx, t, client, "http://"+privateHostName+path, []ResponseExpectation{StatusCodeExpectation(sets.New(http.StatusNotFound))}, true)
RuntimeRequestWithExpectations(ctx, t, client, "http://"+privateHostName+path, []ResponseExpectation{StatusCodeExpectation(sets.NewInt(http.StatusNotFound))}, true)
}

loadbalancerAddress := localIngress.Status.PrivateLoadBalancer.Ingress[0].DomainInternal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ func TestWebsocketSplit(t *testing.T) {
greenName, greenPort, _ := CreateWebsocketService(ctx, t, clients, suffixGreen)

// The suffixes we expect to see.
want := sets.New(suffixBlue, suffixGreen)
want := sets.NewString(suffixBlue, suffixGreen)

// Create a simple Ingress over the Service.
name := test.ObjectNameForTest(t)
Expand Down Expand Up @@ -132,7 +132,7 @@ func TestWebsocketSplit(t *testing.T) {
u := url.URL{Scheme: "ws", Host: domain, Path: "/"}

const maxRequests = 100
got := sets.New[string]()
got := sets.NewString()
for i := 0; i < maxRequests; i++ {
conn, _, err := dialer.Dial(u.String(), http.Header{"Host": {domain}})
if err != nil {
Expand All @@ -157,7 +157,7 @@ func TestWebsocketSplit(t *testing.T) {
}

// Us getting here means we haven't seen splits.
t.Errorf("(over %d requests) (-want, +got) = %s", maxRequests, cmp.Diff(sets.List(want), sets.List(got)))
t.Errorf("(over %d requests) (-want, +got) = %s", maxRequests, cmp.Diff(want.List(), got.List()))
}

func findWebsocketSuffix(t *testing.T, conn *websocket.Conn) string {
Expand Down
3 changes: 1 addition & 2 deletions vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ k8s.io/utils/trace
# knative.dev/hack v0.0.0-20240108153050-3ea694d6dad7
## explicit; go 1.18
knative.dev/hack
# knative.dev/networking v0.0.0-20240108134621-7cca4b010b25 => github.com/ReToCode/networking v0.0.0-20240109073627-bc010699726a
# knative.dev/networking v0.0.0-20240108134621-7cca4b010b25
## explicit; go 1.18
knative.dev/networking/config
knative.dev/networking/pkg
Expand Down Expand Up @@ -1071,4 +1071,3 @@ sigs.k8s.io/yaml/goyaml.v2
# k8s.io/client-go => k8s.io/client-go v0.27.6
# k8s.io/kube-openapi => k8s.io/kube-openapi v0.0.0-20230501164219-8b0f38b5fd1f
# sigs.k8s.io/structured-merge-diff/v4 => sigs.k8s.io/structured-merge-diff/v4 v4.2.3
# knative.dev/networking => github.com/ReToCode/networking v0.0.0-20240109073627-bc010699726a

0 comments on commit 06c1bab

Please sign in to comment.