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

[main] Upgrade to latest dependencies #1240

Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
k8s.io/client-go v0.29.2
k8s.io/code-generator v0.29.2
knative.dev/hack v0.0.0-20240404013450-1133b37da8d7
knative.dev/networking v0.0.0-20240410133143-200296131672
knative.dev/networking v0.0.0-20240410205709-a3d8b0fc9cd2
knative.dev/pkg v0.0.0-20240409141558-1ff9a77566f6
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -718,8 +718,8 @@ k8s.io/utils v0.0.0-20240102154912-e7106e64919e h1:eQ/4ljkx21sObifjzXwlPKpdGLrCf
k8s.io/utils v0.0.0-20240102154912-e7106e64919e/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
knative.dev/hack v0.0.0-20240404013450-1133b37da8d7 h1:fkWYWvdHm1mVHevKW2vVJnZtxH0NzOlux8imesweKwE=
knative.dev/hack v0.0.0-20240404013450-1133b37da8d7/go.mod h1:yk2OjGDsbEnQjfxdm0/HJKS2WqTLEFg/N6nUs6Rqx3Q=
knative.dev/networking v0.0.0-20240410133143-200296131672 h1:BGHRJN0RzLbB+HMUUUDWLd5ShzLRl+Pk1OV6mMQCqCs=
knative.dev/networking v0.0.0-20240410133143-200296131672/go.mod h1:m9aH65g5JGuwhH6moqAmF0+X6PvIQwElVx5dw2+jDno=
knative.dev/networking v0.0.0-20240410205709-a3d8b0fc9cd2 h1:W8M/cxPYUOIjNcwQ3w2Il/qlYKpZBPJ89ysTr5MTI/A=
knative.dev/networking v0.0.0-20240410205709-a3d8b0fc9cd2/go.mod h1:yXbBRuzGKDkHSdvqUT7/1j9br5gkJL9LAyxpHfcF3h8=
knative.dev/pkg v0.0.0-20240409141558-1ff9a77566f6 h1:jJVStFc+y8c7veKYDyQFwQTod+w5pzZqopz/nLH2dJo=
knative.dev/pkg v0.0.0-20240409141558-1ff9a77566f6/go.mod h1:ZWUA+Z6zFI93VyExtnH0P5JtVQ0TvWpKvbxtFvmRJ9I=
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/networking/pkg/prober/prober.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func (m *Manager) doAsync(ctx context.Context, target string, arg interface{}, p
result bool
inErr error
)
err := wait.PollImmediate(period, timeout, func() (bool, error) {
err := wait.PollUntilContextTimeout(ctx, period, timeout, true, func(ctx context.Context) (bool, error) {
result, inErr = Do(ctx, m.transport, target, ops...)
// Do not return error, which is from verifierError, as retry is expected until timeout.
return result, nil
Expand Down
26 changes: 15 additions & 11 deletions vendor/knative.dev/networking/test/conformance/ingress/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,21 +83,25 @@ func TestProbeHeaders(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()

ros := []RequestOption{}
req, err := http.NewRequest("GET", fmt.Sprintf("http://%s.%s", name, test.NetworkingFlags.ServiceDomain), nil)
if err != nil {
t.Fatal("Error creating request:", err)
}
req.Header.Set(header.ProbeKey, header.ProbeValue)
req.Header.Set(header.HashKey, tt.req)

ros = append(ros, func(r *http.Request) {
// Add the header to indicate this is a probe request.
r.Header.Set(header.ProbeKey, header.ProbeValue)
r.Header.Set(header.HashKey, tt.req)
})
resp, err := client.Do(req)
if err != nil {
t.Fatal("Error making GET request:", err)
}
defer resp.Body.Close()

ri := RuntimeRequest(ctx, t, client, "http://"+name+"."+test.NetworkingFlags.ServiceDomain, ros...)
if ri == nil {
t.Error("Couldn't make request")
return
if resp.StatusCode != http.StatusOK {
t.Errorf("Unexpected status code: %d, wanted %d", resp.StatusCode, http.StatusOK)
DumpResponse(ctx, t, resp)
}

if got, want := ri.Request.Headers.Get(header.HashKey), tt.want; got != want {
if got, want := resp.Header.Get(header.HashKey), tt.want; got != want {
t.Errorf("Header[%q] = %q, wanted %q", header.HashKey, got, want)
}
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -749,7 +749,7 @@ func createPodAndService(ctx context.Context, t *testing.T, clients *test.Client
}

// Wait for the Pod to show up in the Endpoints resource.
waitErr := wait.PollImmediate(test.PollInterval, test.PollTimeout, func() (bool, error) {
waitErr := wait.PollUntilContextTimeout(ctx, test.PollInterval, test.PollTimeout, true, func(ctx context.Context) (bool, error) {
var ep *corev1.Endpoints
err := reconciler.RetryTestErrors(func(attempts int) (err error) {
ep, err = clients.KubeClient.CoreV1().Endpoints(svc.Namespace).Get(ctx, svc.Name, metav1.GetOptions{})
Expand Down Expand Up @@ -1212,7 +1212,7 @@ func WaitForIngressState(ctx context.Context, client *test.NetworkingClients, na
defer span.End()

var lastState *v1alpha1.Ingress
waitErr := wait.PollImmediate(test.PollInterval, test.PollTimeout, func() (bool, error) {
waitErr := wait.PollUntilContextTimeout(ctx, test.PollInterval, test.PollTimeout, true, func(ctx context.Context) (bool, error) {
err := reconciler.RetryTestErrors(func(attempts int) (err error) {
lastState, err = client.Ingresses.Get(ctx, name, metav1.GetOptions{})
return err
Expand Down
2 changes: 1 addition & 1 deletion vendor/knative.dev/networking/test/ingress.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func WaitForIngressState(ctx context.Context, client *NetworkingClients, name st
defer span.End()

var lastState *v1alpha1.Ingress
waitErr := wait.PollImmediate(PollInterval, PollTimeout, func() (bool, error) {
waitErr := wait.PollUntilContextTimeout(ctx, PollInterval, PollTimeout, true, func(ctx context.Context) (bool, error) {
var err error
lastState, err = client.Ingresses.Get(ctx, name, metav1.GetOptions{})
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ import (
"strings"

nethttp "knative.dev/networking/pkg/http"
"knative.dev/networking/pkg/http/probe"
"knative.dev/pkg/network"
)

// InitHandlers initializes all handlers.
func InitHandlers(mux *http.ServeMux) {
mux.HandleFunc("/", withHeaders(withRequestLog(runtimeHandler)))

h := probe.NewHandler(withRequestLog(withKubeletProbeHeaderCheck))
mux.HandleFunc(nethttp.HealthCheckPath, h.ServeHTTP)
mux.HandleFunc(nethttp.HealthCheckPath, withRequestLog(withKubeletProbeHeaderCheck))
}

// withRequestLog logs each request before handling it.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"net/http"
"os"

"knative.dev/networking/pkg/http/probe"
"knative.dev/networking/test"
"knative.dev/networking/test/test_images/runtime/handlers"
)
Expand All @@ -48,11 +49,13 @@ func main() {
mux := http.NewServeMux()
handlers.InitHandlers(mux)

h := probe.NewHandler(mux)

if cert, key := os.Getenv("CERT"), os.Getenv("KEY"); cert != "" && key != "" {
log.Print("Server starting on port with TLS ", port)
test.ListenAndServeTLSGracefullyWithHandler(cert, key, ":"+port, mux)
test.ListenAndServeTLSGracefullyWithHandler(cert, key, ":"+port, h)
} else {
log.Print("Server starting on port ", port)
test.ListenAndServeGracefullyWithHandler(":"+port, mux)
test.ListenAndServeGracefullyWithHandler(":"+port, h)
}
}
2 changes: 1 addition & 1 deletion vendor/modules.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1012,7 +1012,7 @@ k8s.io/utils/trace
# knative.dev/hack v0.0.0-20240404013450-1133b37da8d7
## explicit; go 1.18
knative.dev/hack
# knative.dev/networking v0.0.0-20240410133143-200296131672
# knative.dev/networking v0.0.0-20240410205709-a3d8b0fc9cd2
## explicit; go 1.21
knative.dev/networking/config
knative.dev/networking/pkg
Expand Down
Loading