From 7fac1b543d1f825447dad7acceb2f1f2ba0a0d76 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Thu, 29 Jun 2023 11:12:42 +0900 Subject: [PATCH 01/18] Add gRPC probe --- config/core/300-resources/configuration.yaml | 26 ++++++ config/core/300-resources/revision.yaml | 26 ++++++ config/core/300-resources/service.yaml | 26 ++++++ go.mod | 2 +- hack/schemapatch-config.yaml | 5 ++ pkg/apis/serving/fieldmask.go | 17 ++++ pkg/apis/serving/fieldmask_test.go | 28 +++++++ pkg/apis/serving/k8s_validation.go | 6 +- pkg/apis/serving/k8s_validation_test.go | 25 ++++++ pkg/apis/serving/v1/revision_defaults.go | 3 +- pkg/queue/health/probe.go | 83 +++++++++++++++++++ pkg/queue/readiness/probe.go | 14 ++++ pkg/reconciler/revision/resources/queue.go | 6 +- .../runtime/readiness_probe_test.go | 9 ++ 14 files changed, 272 insertions(+), 4 deletions(-) diff --git a/config/core/300-resources/configuration.yaml b/config/core/300-resources/configuration.yaml index 80db933c47ac..acd9c2cc6ddb 100644 --- a/config/core/300-resources/configuration.yaml +++ b/config/core/300-resources/configuration.yaml @@ -247,6 +247,19 @@ spec: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. type: integer format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string httpGet: description: HTTPGet specifies the http request to perform. type: object @@ -355,6 +368,19 @@ spec: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. type: integer format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string httpGet: description: HTTPGet specifies the http request to perform. type: object diff --git a/config/core/300-resources/revision.yaml b/config/core/300-resources/revision.yaml index 00c98bd84cfb..9cc3fe276bda 100644 --- a/config/core/300-resources/revision.yaml +++ b/config/core/300-resources/revision.yaml @@ -226,6 +226,19 @@ spec: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. type: integer format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string httpGet: description: HTTPGet specifies the http request to perform. type: object @@ -334,6 +347,19 @@ spec: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. type: integer format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string httpGet: description: HTTPGet specifies the http request to perform. type: object diff --git a/config/core/300-resources/service.yaml b/config/core/300-resources/service.yaml index dc489fba43ea..922461fafd91 100644 --- a/config/core/300-resources/service.yaml +++ b/config/core/300-resources/service.yaml @@ -251,6 +251,19 @@ spec: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. type: integer format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string httpGet: description: HTTPGet specifies the http request to perform. type: object @@ -359,6 +372,19 @@ spec: description: Minimum consecutive failures for the probe to be considered failed after having succeeded. Defaults to 3. Minimum value is 1. type: integer format: int32 + grpc: + description: GRPC specifies an action involving a GRPC port. This is a beta field and requires enabling GRPCContainerProbe feature gate. + type: object + required: + - port + properties: + port: + description: Port number of the gRPC service. Number must be in the range 1 to 65535. + type: integer + format: int32 + service: + description: "Service is the name of the service to place in the gRPC HealthCheckRequest (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). \n If this is not specified, the default behavior is defined by gRPC." + type: string httpGet: description: HTTPGet specifies the http request to perform. type: object diff --git a/go.mod b/go.mod index fd930f1f561b..3465b1d6ef67 100644 --- a/go.mod +++ b/go.mod @@ -4,6 +4,7 @@ go 1.18 require ( github.com/ahmetb/gen-crd-api-reference-docs v0.3.1-0.20210609063737-0067dc6dcea2 + github.com/aws/smithy-go v1.13.3 github.com/davecgh/go-spew v1.1.1 github.com/gogo/protobuf v1.3.2 github.com/google/go-cmp v0.5.9 @@ -67,7 +68,6 @@ require ( github.com/aws/aws-sdk-go-v2/service/sso v1.11.23 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.6 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.16.19 // indirect - github.com/aws/smithy-go v1.13.3 // indirect github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20221004211355-a250ad2ca1e3 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect diff --git a/hack/schemapatch-config.yaml b/hack/schemapatch-config.yaml index febc4a034ad0..d7b9babb9fdb 100644 --- a/hack/schemapatch-config.yaml +++ b/hack/schemapatch-config.yaml @@ -198,6 +198,11 @@ k8s.io/api/core/v1.ProbeHandler: - Exec - HTTPGet - TCPSocket + - GRPC +k8s.io/api/core/v1.GRPCAction: + fieldMask: + - Port + - Service k8s.io/api/core/v1.ExecAction: fieldMask: - Command diff --git a/pkg/apis/serving/fieldmask.go b/pkg/apis/serving/fieldmask.go index 1d4dd77ebfe0..7c02f174dae3 100644 --- a/pkg/apis/serving/fieldmask.go +++ b/pkg/apis/serving/fieldmask.go @@ -374,6 +374,7 @@ func HandlerMask(in *corev1.ProbeHandler) *corev1.ProbeHandler { out.Exec = in.Exec out.HTTPGet = in.HTTPGet out.TCPSocket = in.TCPSocket + out.GRPC = in.GRPC return out @@ -429,6 +430,22 @@ func TCPSocketActionMask(in *corev1.TCPSocketAction) *corev1.TCPSocketAction { return out } +// GRPCActionMask performs a _shallow_ copy of the Kubernetes GRPCAction object to a new +// Kubernetes GRPCAction object bringing over only the fields allowed in the Knative API. This +// does not validate the contents or the bounds of the provided fields. +func GRPCActionMask(in *corev1.GRPCAction) *corev1.GRPCAction { + if in == nil { + return nil + } + out := new(corev1.GRPCAction) + + // Allowed fields + out.Port = in.Port + out.Service = in.Service + + return out +} + // ContainerPortMask performs a _shallow_ copy of the Kubernetes ContainerPort object to a new // Kubernetes ContainerPort object bringing over only the fields allowed in the Knative API. This // does not validate the contents or the bounds of the provided fields. diff --git a/pkg/apis/serving/fieldmask_test.go b/pkg/apis/serving/fieldmask_test.go index 5e957bb92521..9d22654ce474 100644 --- a/pkg/apis/serving/fieldmask_test.go +++ b/pkg/apis/serving/fieldmask_test.go @@ -318,6 +318,7 @@ func TestHandlerMask(t *testing.T) { Exec: &corev1.ExecAction{}, HTTPGet: &corev1.HTTPGetAction{}, TCPSocket: &corev1.TCPSocketAction{}, + GRPC: &corev1.GRPCAction{}, } in := want @@ -421,6 +422,33 @@ func TestTCPSocketActionMask(t *testing.T) { } } +func TestGRPCActionMask(t *testing.T) { + want := &corev1.GRPCAction{ + Port: 42, + Service: ptr.String("foo"), + } + in := &corev1.GRPCAction{ + Port: 42, + Service: ptr.String("foo"), + } + + got := GRPCActionMask(in) + + if &want == &got { + t.Error("Input and output share addresses. Want different addresses") + } + + if diff, err := kmp.SafeDiff(want, got); err != nil { + t.Error("Got error comparing output, err =", err) + } else if diff != "" { + t.Error("GRPCActionMask (-want, +got):", diff) + } + + if got = GRPCActionMask(nil); got != nil { + t.Errorf("GRPCActionMask(nil) = %v, want: nil", got) + } +} + func TestContainerPortMask(t *testing.T) { want := &corev1.ContainerPort{ ContainerPort: 42, diff --git a/pkg/apis/serving/k8s_validation.go b/pkg/apis/serving/k8s_validation.go index efa65a05e914..797dfb38a508 100644 --- a/pkg/apis/serving/k8s_validation.go +++ b/pkg/apis/serving/k8s_validation.go @@ -832,9 +832,13 @@ func validateProbe(p *corev1.Probe, port corev1.ContainerPort) *apis.FieldError handlers = append(handlers, "exec") errs = errs.Also(apis.CheckDisallowedFields(*h.Exec, *ExecActionMask(h.Exec))).ViaField("exec") } + if h.GRPC != nil { + handlers = append(handlers, "gRPC") + errs = errs.Also(apis.CheckDisallowedFields(*h.GRPC, *GRPCActionMask(h.GRPC))).ViaField("grpc") + } if len(handlers) == 0 { - errs = errs.Also(apis.ErrMissingOneOf("httpGet", "tcpSocket", "exec")) + errs = errs.Also(apis.ErrMissingOneOf("httpGet", "tcpSocket", "exec", "grpc")) } else if len(handlers) > 1 { errs = errs.Also(apis.ErrMultipleOneOf(handlers...)) } diff --git a/pkg/apis/serving/k8s_validation_test.go b/pkg/apis/serving/k8s_validation_test.go index 9f73a98c43ca..c7db35cfab3f 100644 --- a/pkg/apis/serving/k8s_validation_test.go +++ b/pkg/apis/serving/k8s_validation_test.go @@ -1888,6 +1888,31 @@ func TestContainerValidation(t *testing.T) { }, want: apis.ErrDisallowedFields("lifecycle").Also( apis.ErrMissingField("image")), + }, { + name: "valid grpc probe", + c: corev1.Container{ + Name: "foo", + ReadinessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + GRPC: &corev1.GRPCAction{ + Port: 46, + }, + }, + }, + }, + }, { + name: "valid grpc probe with service", + c: corev1.Container{ + Name: "foo", + ReadinessProbe: &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + GRPC: &corev1.GRPCAction{ + Port: 46, + Service: ptr.String("foo"), + }, + }, + }, + }, }, } tests = append(tests, getCommonContainerValidationTestCases()...) diff --git a/pkg/apis/serving/v1/revision_defaults.go b/pkg/apis/serving/v1/revision_defaults.go index 8acbf3446fd1..83fb9069b80a 100644 --- a/pkg/apis/serving/v1/revision_defaults.go +++ b/pkg/apis/serving/v1/revision_defaults.go @@ -143,7 +143,8 @@ func (*RevisionSpec) applyProbes(container *corev1.Container) { } if container.ReadinessProbe.TCPSocket == nil && container.ReadinessProbe.HTTPGet == nil && - container.ReadinessProbe.Exec == nil { + container.ReadinessProbe.Exec == nil && + container.ReadinessProbe.GRPC == nil { container.ReadinessProbe.TCPSocket = &corev1.TCPSocketAction{} } diff --git a/pkg/queue/health/probe.go b/pkg/queue/health/probe.go index 0151bbe05316..c47e466eb2d6 100644 --- a/pkg/queue/health/probe.go +++ b/pkg/queue/health/probe.go @@ -17,14 +17,25 @@ limitations under the License. package health import ( + "context" "fmt" "io" "net" "net/http" "net/url" + "syscall" "time" + "github.com/aws/smithy-go/ptr" + "golang.org/x/sys/unix" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/credentials/insecure" + grpchealth "google.golang.org/grpc/health/grpc_health_v1" + "google.golang.org/grpc/metadata" + "google.golang.org/grpc/status" corev1 "k8s.io/api/core/v1" + "k8s.io/client-go/pkg/version" netheader "knative.dev/networking/pkg/http/header" pkgnet "knative.dev/pkg/network" ) @@ -44,6 +55,12 @@ type TCPProbeConfigOptions struct { Address string } +// GRPCProbeConfigOptions holds the gRPC probe config options +type GRPCProbeConfigOptions struct { + Timeout time.Duration + *corev1.GRPCAction +} + // TCPProbe checks that a TCP socket to the address can be opened. // Did not reuse k8s.io/kubernetes/pkg/probe/tcp to not create a dependency // on klog. @@ -204,3 +221,69 @@ func isHTTPProbeReady(res *http.Response) bool { // response status code between 200-399 indicates success return res.StatusCode >= 200 && res.StatusCode < 400 } + +// GRPCProbe checks that gRPC connection can be established to the address. +func GRPCProbe(config GRPCProbeConfigOptions) error { + dialer := &net.Dialer{ + Control: func(network, address string, c syscall.RawConn) error { + return c.Control(func(fd uintptr) { + unix.SetsockoptLinger(int(fd), syscall.SOL_SOCKET, syscall.SO_LINGER, &unix.Linger{Onoff: 1, Linger: 1}) + }) + }, + } + + v := version.Get() + + opts := []grpc.DialOption{ + grpc.WithUserAgent(fmt.Sprintf("kube-probe/%s.%s", v.Major, v.Minor)), + grpc.WithBlock(), + grpc.WithTransportCredentials(insecure.NewCredentials()), // credentials are currently not supported + grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) { + return dialer.DialContext(ctx, "tcp", addr) + }), + } + + ctx, cancel := context.WithTimeout(context.Background(), config.Timeout) + + defer cancel() + + addr := net.JoinHostPort("127.0.0.1", fmt.Sprintf("%d", config.Port)) + conn, err := grpc.DialContext(ctx, addr, opts...) + + if err != nil { + if err == context.DeadlineExceeded { + return fmt.Errorf("timeout: failed to connect service %q within %v", addr, config.Timeout) + } else { + return fmt.Errorf("error: failed to connect service at %q", addr) + } + } + + defer func() { + _ = conn.Close() + }() + + client := grpchealth.NewHealthClient(conn) + + resp, err := client.Check(metadata.NewOutgoingContext(ctx, make(metadata.MD)), &grpchealth.HealthCheckRequest{ + Service: ptr.ToString(config.Service), + }) + + if err != nil { + stat, ok := status.FromError(err) + if ok { + switch stat.Code() { + case codes.Unimplemented: + return fmt.Errorf("error: this server does not implement the grpc health protocol (grpc.health.v1.Health): %s", stat.Message()) + case codes.DeadlineExceeded: + return fmt.Errorf("timeout: health rpc did not complete within %v", config.Timeout) + } + } + return fmt.Errorf("error: health rpc probe failed: %+v", err) + } + + if resp.GetStatus() != grpchealth.HealthCheckResponse_SERVING { + return fmt.Errorf("service unhealthy (responded with %q)", resp.GetStatus().String()) + } + + return nil +} diff --git a/pkg/queue/readiness/probe.go b/pkg/queue/readiness/probe.go index 2d8e0e16250f..f2c5dad15182 100644 --- a/pkg/queue/readiness/probe.go +++ b/pkg/queue/readiness/probe.go @@ -134,6 +134,8 @@ func (p *Probe) probeContainerImpl() bool { err = p.httpProbe() case p.TCPSocket != nil: err = p.tcpProbe() + case p.GRPC != nil: + err = p.grpcProbe() case p.Exec != nil: // Should never be reachable. Exec probes to be translated to // TCP probes when container is built. @@ -220,3 +222,15 @@ func (p *Probe) httpProbe() error { return health.HTTPProbe(config) }) } + +// grpcProbe function executes gRPC probe +func (p *Probe) grpcProbe() error { + config := health.GRPCProbeConfigOptions{ + GRPCAction: p.GRPC, + } + + return p.doProbe(func(to time.Duration) error { + config.Timeout = to + return health.GRPCProbe(config) + }) +} diff --git a/pkg/reconciler/revision/resources/queue.go b/pkg/reconciler/revision/resources/queue.go index 01263613c74c..b8cd617efe15 100644 --- a/pkg/reconciler/revision/resources/queue.go +++ b/pkg/reconciler/revision/resources/queue.go @@ -268,7 +268,9 @@ func makeQueueContainer(rev *v1.Revision, cfg *config.Config) (*corev1.Container if container.ReadinessProbe.TCPSocket != nil && container.ReadinessProbe.TCPSocket.Port.IntValue() != 0 { probePort = container.ReadinessProbe.TCPSocket.Port.IntVal } - + if container.ReadinessProbe.GRPC != nil && container.ReadinessProbe.GRPC.Port > 0 { + probePort = container.ReadinessProbe.GRPC.Port + } // The activator attempts to detect readiness itself by checking the Queue // Proxy's health endpoint rather than waiting for Kubernetes to check and // propagate the Ready state. We encode the original probe as JSON in an @@ -449,6 +451,8 @@ func applyReadinessProbeDefaultsForExec(p *corev1.Probe, port int32) { Port: intstr.FromInt(int(port)), } p.Exec = nil + case p.GRPC != nil: + p.GRPC.Port = port } if p.PeriodSeconds > 0 && p.TimeoutSeconds < 1 { diff --git a/test/conformance/runtime/readiness_probe_test.go b/test/conformance/runtime/readiness_probe_test.go index 80bb0d15cf02..011f50a08550 100644 --- a/test/conformance/runtime/readiness_probe_test.go +++ b/test/conformance/runtime/readiness_probe_test.go @@ -95,6 +95,15 @@ func TestProbeRuntime(t *testing.T) { Command: []string{"/ko-app/readiness", "probe"}, }, }, + }, { + name: "grpc", + env: []corev1.EnvVar{{ + Name: "READY_DELAY", + Value: "10s", + }}, + handler: corev1.ProbeHandler{ + GRPC: &corev1.GRPCAction{}, + }, }} for _, tc := range testCases { From 26193ddc84dc0b9a9e85727058ae151d51675015 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Mon, 3 Jul 2023 00:31:50 +0900 Subject: [PATCH 02/18] Modify unit test --- pkg/apis/serving/k8s_validation_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/apis/serving/k8s_validation_test.go b/pkg/apis/serving/k8s_validation_test.go index c7db35cfab3f..77ecf3581232 100644 --- a/pkg/apis/serving/k8s_validation_test.go +++ b/pkg/apis/serving/k8s_validation_test.go @@ -1654,7 +1654,7 @@ func TestContainerValidation(t *testing.T) { ProbeHandler: corev1.ProbeHandler{}, }, }, - want: apis.ErrMissingOneOf("livenessProbe.httpGet", "livenessProbe.tcpSocket", "livenessProbe.exec"), + want: apis.ErrMissingOneOf("livenessProbe.httpGet", "livenessProbe.tcpSocket", "livenessProbe.exec", "livenessProbe.grpc"), }, { name: "invalid with multiple handlers", c: corev1.Container{ @@ -1891,7 +1891,7 @@ func TestContainerValidation(t *testing.T) { }, { name: "valid grpc probe", c: corev1.Container{ - Name: "foo", + Image: "foo", ReadinessProbe: &corev1.Probe{ ProbeHandler: corev1.ProbeHandler{ GRPC: &corev1.GRPCAction{ @@ -1903,7 +1903,7 @@ func TestContainerValidation(t *testing.T) { }, { name: "valid grpc probe with service", c: corev1.Container{ - Name: "foo", + Image: "foo", ReadinessProbe: &corev1.Probe{ ProbeHandler: corev1.ProbeHandler{ GRPC: &corev1.GRPCAction{ From 4fd0cba3258734675eb1265966d90f22289edc08 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Tue, 4 Jul 2023 16:45:35 +0900 Subject: [PATCH 03/18] Modify unit test --- pkg/apis/serving/k8s_validation_test.go | 8 ++++++++ test/conformance/runtime/readiness_probe_test.go | 9 --------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/pkg/apis/serving/k8s_validation_test.go b/pkg/apis/serving/k8s_validation_test.go index 77ecf3581232..16bf426a640a 100644 --- a/pkg/apis/serving/k8s_validation_test.go +++ b/pkg/apis/serving/k8s_validation_test.go @@ -1893,6 +1893,10 @@ func TestContainerValidation(t *testing.T) { c: corev1.Container{ Image: "foo", ReadinessProbe: &corev1.Probe{ + PeriodSeconds: 1, + TimeoutSeconds: 1, + SuccessThreshold: 1, + FailureThreshold: 3, ProbeHandler: corev1.ProbeHandler{ GRPC: &corev1.GRPCAction{ Port: 46, @@ -1905,6 +1909,10 @@ func TestContainerValidation(t *testing.T) { c: corev1.Container{ Image: "foo", ReadinessProbe: &corev1.Probe{ + PeriodSeconds: 1, + TimeoutSeconds: 1, + SuccessThreshold: 1, + FailureThreshold: 3, ProbeHandler: corev1.ProbeHandler{ GRPC: &corev1.GRPCAction{ Port: 46, diff --git a/test/conformance/runtime/readiness_probe_test.go b/test/conformance/runtime/readiness_probe_test.go index 011f50a08550..80bb0d15cf02 100644 --- a/test/conformance/runtime/readiness_probe_test.go +++ b/test/conformance/runtime/readiness_probe_test.go @@ -95,15 +95,6 @@ func TestProbeRuntime(t *testing.T) { Command: []string{"/ko-app/readiness", "probe"}, }, }, - }, { - name: "grpc", - env: []corev1.EnvVar{{ - Name: "READY_DELAY", - Value: "10s", - }}, - handler: corev1.ProbeHandler{ - GRPC: &corev1.GRPCAction{}, - }, }} for _, tc := range testCases { From 382dae61d6e671932a2cde7e92ac4938948dadf4 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Mon, 10 Jul 2023 00:18:34 +0900 Subject: [PATCH 04/18] Set default to grpcprobe's service field --- pkg/apis/serving/v1/revision_defaults.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/apis/serving/v1/revision_defaults.go b/pkg/apis/serving/v1/revision_defaults.go index 83fb9069b80a..e6679b515129 100644 --- a/pkg/apis/serving/v1/revision_defaults.go +++ b/pkg/apis/serving/v1/revision_defaults.go @@ -148,6 +148,10 @@ func (*RevisionSpec) applyProbes(container *corev1.Container) { container.ReadinessProbe.TCPSocket = &corev1.TCPSocketAction{} } + if container.ReadinessProbe.GRPC != nil && container.ReadinessProbe.GRPC.Service == nil { + container.ReadinessProbe.GRPC.Service = ptr.String("") + } + if container.ReadinessProbe.SuccessThreshold == 0 { container.ReadinessProbe.SuccessThreshold = 1 } From 3f9109b8d82dd0c4a4db5aeefe0f94b6061d6189 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Mon, 10 Jul 2023 00:21:03 +0900 Subject: [PATCH 05/18] Use knative pkg for ptr operation --- pkg/queue/health/probe.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/queue/health/probe.go b/pkg/queue/health/probe.go index c47e466eb2d6..3e057ecff069 100644 --- a/pkg/queue/health/probe.go +++ b/pkg/queue/health/probe.go @@ -26,7 +26,6 @@ import ( "syscall" "time" - "github.com/aws/smithy-go/ptr" "golang.org/x/sys/unix" "google.golang.org/grpc" "google.golang.org/grpc/codes" @@ -38,6 +37,7 @@ import ( "k8s.io/client-go/pkg/version" netheader "knative.dev/networking/pkg/http/header" pkgnet "knative.dev/pkg/network" + "knative.dev/pkg/ptr" ) // HTTPProbeConfigOptions holds the HTTP probe config options @@ -265,7 +265,7 @@ func GRPCProbe(config GRPCProbeConfigOptions) error { client := grpchealth.NewHealthClient(conn) resp, err := client.Check(metadata.NewOutgoingContext(ctx, make(metadata.MD)), &grpchealth.HealthCheckRequest{ - Service: ptr.ToString(config.Service), + Service: ptr.StringValue(config.Service), }) if err != nil { From 9649a83c51a8fa437e8173566df72f63615c830f Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Mon, 10 Jul 2023 00:27:26 +0900 Subject: [PATCH 06/18] Use config's KubeMajor & KubeMinor instead of k8s native version pkg --- pkg/queue/health/probe.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/queue/health/probe.go b/pkg/queue/health/probe.go index 3e057ecff069..931bee748c7a 100644 --- a/pkg/queue/health/probe.go +++ b/pkg/queue/health/probe.go @@ -34,7 +34,6 @@ import ( "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" corev1 "k8s.io/api/core/v1" - "k8s.io/client-go/pkg/version" netheader "knative.dev/networking/pkg/http/header" pkgnet "knative.dev/pkg/network" "knative.dev/pkg/ptr" @@ -59,6 +58,8 @@ type TCPProbeConfigOptions struct { type GRPCProbeConfigOptions struct { Timeout time.Duration *corev1.GRPCAction + KubeMajor string + KubeMinor string } // TCPProbe checks that a TCP socket to the address can be opened. @@ -232,10 +233,8 @@ func GRPCProbe(config GRPCProbeConfigOptions) error { }, } - v := version.Get() - opts := []grpc.DialOption{ - grpc.WithUserAgent(fmt.Sprintf("kube-probe/%s.%s", v.Major, v.Minor)), + grpc.WithUserAgent(netheader.KubeProbeUAPrefix + config.KubeMajor + "/" + config.KubeMinor), grpc.WithBlock(), grpc.WithTransportCredentials(insecure.NewCredentials()), // credentials are currently not supported grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) { From 103086169f60611cd141a5261acd354a593a3b7f Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Mon, 10 Jul 2023 00:38:10 +0900 Subject: [PATCH 07/18] Wrap error in GRPCProbe --- pkg/queue/health/probe.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/queue/health/probe.go b/pkg/queue/health/probe.go index 931bee748c7a..53ab0693cf8a 100644 --- a/pkg/queue/health/probe.go +++ b/pkg/queue/health/probe.go @@ -251,9 +251,9 @@ func GRPCProbe(config GRPCProbeConfigOptions) error { if err != nil { if err == context.DeadlineExceeded { - return fmt.Errorf("timeout: failed to connect service %q within %v", addr, config.Timeout) + return fmt.Errorf("failed to connect service %q within %v: %w", addr, config.Timeout, err) } else { - return fmt.Errorf("error: failed to connect service at %q", addr) + return fmt.Errorf("failed to connect service at %q: %w", addr, err) } } @@ -272,12 +272,12 @@ func GRPCProbe(config GRPCProbeConfigOptions) error { if ok { switch stat.Code() { case codes.Unimplemented: - return fmt.Errorf("error: this server does not implement the grpc health protocol (grpc.health.v1.Health): %s", stat.Message()) + return fmt.Errorf("this server does not implement the grpc health protocol (grpc.health.v1.Health) %w", err) case codes.DeadlineExceeded: - return fmt.Errorf("timeout: health rpc did not complete within %v", config.Timeout) + return fmt.Errorf("health rpc did not complete within %v: %w", config.Timeout, err) } } - return fmt.Errorf("error: health rpc probe failed: %+v", err) + return fmt.Errorf("health rpc probe failed: %w", err) } if resp.GetStatus() != grpchealth.HealthCheckResponse_SERVING { From c5e02412f094f824b471bf0e365bbac109f0445d Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Mon, 10 Jul 2023 00:51:17 +0900 Subject: [PATCH 08/18] Add comment to explain why use dialer_others.go --- pkg/queue/health/probe.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/queue/health/probe.go b/pkg/queue/health/probe.go index 53ab0693cf8a..43c2c255d59e 100644 --- a/pkg/queue/health/probe.go +++ b/pkg/queue/health/probe.go @@ -225,6 +225,8 @@ func isHTTPProbeReady(res *http.Response) bool { // GRPCProbe checks that gRPC connection can be established to the address. func GRPCProbe(config GRPCProbeConfigOptions) error { + + // Use k8s.io/kubernetes/pkg/probe/dialer_others.go to correspond to OSs other than Windows dialer := &net.Dialer{ Control: func(network, address string, c syscall.RawConn) error { return c.Control(func(fd uintptr) { From 755063207b0c83dc02508fc68d817c0f48c58d31 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Mon, 10 Jul 2023 22:32:46 +0900 Subject: [PATCH 09/18] Run update scripts --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3465b1d6ef67..fd930f1f561b 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,6 @@ go 1.18 require ( github.com/ahmetb/gen-crd-api-reference-docs v0.3.1-0.20210609063737-0067dc6dcea2 - github.com/aws/smithy-go v1.13.3 github.com/davecgh/go-spew v1.1.1 github.com/gogo/protobuf v1.3.2 github.com/google/go-cmp v0.5.9 @@ -68,6 +67,7 @@ require ( github.com/aws/aws-sdk-go-v2/service/sso v1.11.23 // indirect github.com/aws/aws-sdk-go-v2/service/ssooidc v1.13.6 // indirect github.com/aws/aws-sdk-go-v2/service/sts v1.16.19 // indirect + github.com/aws/smithy-go v1.13.3 // indirect github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20221004211355-a250ad2ca1e3 // indirect github.com/benbjohnson/clock v1.3.0 // indirect github.com/beorn7/perks v1.0.1 // indirect From 27dce7421ba5895904638912e7dfd9d6557923d8 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Sun, 16 Jul 2023 16:49:05 +0900 Subject: [PATCH 10/18] Add probe test --- pkg/queue/health/probe_test.go | 62 ++++ .../google/mako/go/quickstore/BUILD | 24 ++ .../google/mako/internal/go/common/BUILD | 14 + .../v2/internal/httprule/BUILD.bazel | 35 ++ .../grpc-gateway/v2/runtime/BUILD.bazel | 97 ++++++ .../grpc-gateway/v2/utilities/BUILD.bazel | 31 ++ .../grpc/test/bufconn/bufconn.go | 318 ++++++++++++++++++ .../k8s.io/apimachinery/pkg/api/errors/OWNERS | 17 + .../k8s.io/apimachinery/pkg/api/meta/OWNERS | 14 + .../apimachinery/pkg/api/resource/OWNERS | 11 + .../apimachinery/pkg/apis/meta/v1/OWNERS | 16 + .../apimachinery/pkg/util/mergepatch/OWNERS | 6 + .../pkg/util/strategicpatch/OWNERS | 8 + .../third_party/forked/golang/json/OWNERS | 6 + .../pkg/apis/clientauthentication/OWNERS | 8 + vendor/k8s.io/client-go/rest/OWNERS | 14 + vendor/k8s.io/client-go/tools/auth/OWNERS | 8 + vendor/k8s.io/client-go/tools/cache/OWNERS | 28 ++ .../client-go/tools/leaderelection/OWNERS | 11 + vendor/k8s.io/client-go/tools/metrics/OWNERS | 5 + vendor/k8s.io/client-go/tools/record/OWNERS | 6 + vendor/k8s.io/client-go/transport/OWNERS | 8 + vendor/k8s.io/client-go/util/cert/OWNERS | 8 + vendor/k8s.io/client-go/util/keyutil/OWNERS | 6 + vendor/k8s.io/client-go/util/retry/OWNERS | 4 + vendor/k8s.io/code-generator/OWNERS | 13 + .../code-generator/cmd/client-gen/OWNERS | 10 + .../code-generator/cmd/go-to-protobuf/OWNERS | 6 + vendor/k8s.io/klog/OWNERS | 19 ++ vendor/k8s.io/klog/v2/OWNERS | 14 + .../kube-openapi/pkg/generators/rules/OWNERS | 4 + .../k8s.io/kube-openapi/pkg/util/proto/OWNERS | 2 + vendor/k8s.io/utils/pointer/OWNERS | 10 + vendor/knative.dev/hack/OWNERS | 8 + vendor/knative.dev/hack/OWNERS_ALIASES | 168 +++++++++ vendor/knative.dev/pkg/apis/OWNERS | 15 + vendor/knative.dev/pkg/apis/duck/OWNERS | 8 + vendor/knative.dev/pkg/controller/OWNERS | 7 + vendor/knative.dev/pkg/hack/OWNERS | 10 + vendor/knative.dev/pkg/reconciler/OWNERS | 7 + vendor/knative.dev/pkg/resolver/OWNERS | 8 + vendor/knative.dev/pkg/test/OWNERS | 10 + vendor/knative.dev/pkg/webhook/OWNERS | 7 + vendor/modules.txt | 1 + vendor/sigs.k8s.io/json/OWNERS | 6 + vendor/sigs.k8s.io/yaml/OWNERS | 27 ++ 46 files changed, 1125 insertions(+) create mode 100644 vendor/github.com/google/mako/go/quickstore/BUILD create mode 100644 vendor/github.com/google/mako/internal/go/common/BUILD create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel create mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel create mode 100644 vendor/google.golang.org/grpc/test/bufconn/bufconn.go create mode 100644 vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS create mode 100644 vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS create mode 100644 vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS create mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS create mode 100644 vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS create mode 100644 vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS create mode 100644 vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS create mode 100644 vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS create mode 100644 vendor/k8s.io/client-go/rest/OWNERS create mode 100644 vendor/k8s.io/client-go/tools/auth/OWNERS create mode 100644 vendor/k8s.io/client-go/tools/cache/OWNERS create mode 100644 vendor/k8s.io/client-go/tools/leaderelection/OWNERS create mode 100644 vendor/k8s.io/client-go/tools/metrics/OWNERS create mode 100644 vendor/k8s.io/client-go/tools/record/OWNERS create mode 100644 vendor/k8s.io/client-go/transport/OWNERS create mode 100644 vendor/k8s.io/client-go/util/cert/OWNERS create mode 100644 vendor/k8s.io/client-go/util/keyutil/OWNERS create mode 100644 vendor/k8s.io/client-go/util/retry/OWNERS create mode 100644 vendor/k8s.io/code-generator/OWNERS create mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/OWNERS create mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS create mode 100644 vendor/k8s.io/klog/OWNERS create mode 100644 vendor/k8s.io/klog/v2/OWNERS create mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS create mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS create mode 100644 vendor/k8s.io/utils/pointer/OWNERS create mode 100644 vendor/knative.dev/hack/OWNERS create mode 100644 vendor/knative.dev/hack/OWNERS_ALIASES create mode 100644 vendor/knative.dev/pkg/apis/OWNERS create mode 100644 vendor/knative.dev/pkg/apis/duck/OWNERS create mode 100644 vendor/knative.dev/pkg/controller/OWNERS create mode 100644 vendor/knative.dev/pkg/hack/OWNERS create mode 100644 vendor/knative.dev/pkg/reconciler/OWNERS create mode 100644 vendor/knative.dev/pkg/resolver/OWNERS create mode 100644 vendor/knative.dev/pkg/test/OWNERS create mode 100644 vendor/knative.dev/pkg/webhook/OWNERS create mode 100644 vendor/sigs.k8s.io/json/OWNERS create mode 100644 vendor/sigs.k8s.io/yaml/OWNERS diff --git a/pkg/queue/health/probe_test.go b/pkg/queue/health/probe_test.go index f309d1f478ad..328be13eb12f 100644 --- a/pkg/queue/health/probe_test.go +++ b/pkg/queue/health/probe_test.go @@ -17,6 +17,9 @@ limitations under the License. package health import ( + "context" + "fmt" + "net" "net/http" "net/http/httptest" "net/url" @@ -28,9 +31,12 @@ import ( "go.uber.org/atomic" "golang.org/x/net/http2" "golang.org/x/net/http2/h2c" + "google.golang.org/grpc" + "google.golang.org/grpc/health/grpc_health_v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/util/intstr" netheader "knative.dev/networking/pkg/http/header" + "knative.dev/pkg/ptr" ) func TestTCPProbe(t *testing.T) { @@ -265,6 +271,24 @@ func TestHTTPProbeResponseErrorFailure(t *testing.T) { } } +func TestGRPCProbeSuccessWithDefaultServiceName(t *testing.T) { + port := 12345 + + if err := newTestGRPCServer(t, port); err != nil { + t.Errorf("Failed to create test grpc server: %v", err) + } + + gRPCAction := newGRPCAction(t, port, "") + config := GRPCProbeConfigOptions{ + Timeout: time.Second, + GRPCAction: gRPCAction, + } + + if err := GRPCProbe(config); err != nil { + t.Error("Expected probe to succeed but it failed with", err) + } +} + func newH2cTestServer(t *testing.T, handler http.HandlerFunc) *httptest.Server { h2s := &http2.Server{} t.Helper() @@ -286,6 +310,27 @@ func newTestServer(t *testing.T, handler http.HandlerFunc) *httptest.Server { return server } +func newTestGRPCServer(t *testing.T, port int) error { + t.Helper() + grpcAddr := fmt.Sprintf("127.0.0.1:%d", port) + lis, err := net.Listen("tcp", grpcAddr) + if err != nil { + t.Fatalf("failed to listen: %v", err) + } + + s := grpc.NewServer() + grpc_health_v1.RegisterHealthServer(s, &grpcHealthServer{}) + + go func() { + if err := s.Serve(lis); err != nil { + t.Fatalf("Failed to run gRPC test server %v", err) + } + }() + t.Cleanup(s.Stop) + + return nil +} + func newHTTPGetAction(t *testing.T, serverURL string) *corev1.HTTPGetAction { t.Helper() @@ -301,3 +346,20 @@ func newHTTPGetAction(t *testing.T, serverURL string) *corev1.HTTPGetAction { Scheme: corev1.URISchemeHTTP, } } + +func newGRPCAction(t *testing.T, port int, service string) *corev1.GRPCAction { + t.Helper() + + return &corev1.GRPCAction{ + Port: int32(port), + Service: ptr.String(service), + } +} + +type grpcHealthServer struct { + grpc_health_v1.UnimplementedHealthServer +} + +func (s *grpcHealthServer) Check(_ context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) { + return &grpc_health_v1.HealthCheckResponse{Status: grpc_health_v1.HealthCheckResponse_SERVING}, nil +} diff --git a/vendor/github.com/google/mako/go/quickstore/BUILD b/vendor/github.com/google/mako/go/quickstore/BUILD new file mode 100644 index 000000000000..4623b68eadea --- /dev/null +++ b/vendor/github.com/google/mako/go/quickstore/BUILD @@ -0,0 +1,24 @@ +# Quickstore library for Go. +# See quickstore.go and go/mako-quickstore for documentation. +# See quickstore_example_test.go for example usage. +package(default_visibility = ["//visibility:public"]) + +licenses(["notice"]) + +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +go_library( + name = "quickstore", + srcs = ["quickstore.go"], + importpath = "github.com/google/mako/go/quickstore", + deps = [ + "//internal/go/common", + "//internal/quickstore_microservice/proto:quickstore_go_grpc_pb", + "//internal/quickstore_microservice/proto:quickstore_go_proto", + "//proto/quickstore:quickstore_go_proto", + "//spec/proto:mako_go_proto", + "@com_github_golang_glog//:go_default_library", + "@com_github_golang_protobuf//proto:go_default_library", + "@org_golang_google_grpc//:go_default_library", + ], +) diff --git a/vendor/github.com/google/mako/internal/go/common/BUILD b/vendor/github.com/google/mako/internal/go/common/BUILD new file mode 100644 index 000000000000..1f90d9eda1e9 --- /dev/null +++ b/vendor/github.com/google/mako/internal/go/common/BUILD @@ -0,0 +1,14 @@ +# Go libraries for mako +package(default_visibility = ["//:internal"]) + +licenses(["notice"]) + +load("@io_bazel_rules_go//go:def.bzl", "go_library") + +go_library( + name = "common", + srcs = [ + "common_deps.go", + ], + importpath = "github.com/google/mako/internal/go/common", +) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel new file mode 100644 index 000000000000..f694f3c0d035 --- /dev/null +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel @@ -0,0 +1,35 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +package(default_visibility = ["//visibility:public"]) + +go_library( + name = "httprule", + srcs = [ + "compile.go", + "parse.go", + "types.go", + ], + importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule", + deps = ["//utilities"], +) + +go_test( + name = "httprule_test", + size = "small", + srcs = [ + "compile_test.go", + "parse_test.go", + "types_test.go", + ], + embed = [":httprule"], + deps = [ + "//utilities", + "@com_github_golang_glog//:glog", + ], +) + +alias( + name = "go_default_library", + actual = ":httprule", + visibility = ["//:__subpackages__"], +) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel new file mode 100644 index 000000000000..b5140a3c9d16 --- /dev/null +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel @@ -0,0 +1,97 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +package(default_visibility = ["//visibility:public"]) + +go_library( + name = "runtime", + srcs = [ + "context.go", + "convert.go", + "doc.go", + "errors.go", + "fieldmask.go", + "handler.go", + "marshal_httpbodyproto.go", + "marshal_json.go", + "marshal_jsonpb.go", + "marshal_proto.go", + "marshaler.go", + "marshaler_registry.go", + "mux.go", + "pattern.go", + "proto2_convert.go", + "query.go", + ], + importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/runtime", + deps = [ + "//internal/httprule", + "//utilities", + "@go_googleapis//google/api:httpbody_go_proto", + "@io_bazel_rules_go//proto/wkt:field_mask_go_proto", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//grpclog", + "@org_golang_google_grpc//health/grpc_health_v1", + "@org_golang_google_grpc//metadata", + "@org_golang_google_grpc//status", + "@org_golang_google_protobuf//encoding/protojson", + "@org_golang_google_protobuf//proto", + "@org_golang_google_protobuf//reflect/protoreflect", + "@org_golang_google_protobuf//reflect/protoregistry", + "@org_golang_google_protobuf//types/known/durationpb", + "@org_golang_google_protobuf//types/known/structpb", + "@org_golang_google_protobuf//types/known/timestamppb", + "@org_golang_google_protobuf//types/known/wrapperspb", + ], +) + +go_test( + name = "runtime_test", + size = "small", + srcs = [ + "context_test.go", + "convert_test.go", + "errors_test.go", + "fieldmask_test.go", + "handler_test.go", + "marshal_httpbodyproto_test.go", + "marshal_json_test.go", + "marshal_jsonpb_test.go", + "marshal_proto_test.go", + "marshaler_registry_test.go", + "mux_internal_test.go", + "mux_test.go", + "pattern_test.go", + "query_fuzz_test.go", + "query_test.go", + ], + embed = [":runtime"], + deps = [ + "//runtime/internal/examplepb", + "//utilities", + "@com_github_google_go_cmp//cmp", + "@com_github_google_go_cmp//cmp/cmpopts", + "@go_googleapis//google/api:httpbody_go_proto", + "@go_googleapis//google/rpc:errdetails_go_proto", + "@go_googleapis//google/rpc:status_go_proto", + "@io_bazel_rules_go//proto/wkt:field_mask_go_proto", + "@org_golang_google_grpc//:go_default_library", + "@org_golang_google_grpc//codes", + "@org_golang_google_grpc//health/grpc_health_v1", + "@org_golang_google_grpc//metadata", + "@org_golang_google_grpc//status", + "@org_golang_google_protobuf//encoding/protojson", + "@org_golang_google_protobuf//proto", + "@org_golang_google_protobuf//testing/protocmp", + "@org_golang_google_protobuf//types/known/durationpb", + "@org_golang_google_protobuf//types/known/emptypb", + "@org_golang_google_protobuf//types/known/structpb", + "@org_golang_google_protobuf//types/known/timestamppb", + "@org_golang_google_protobuf//types/known/wrapperspb", + ], +) + +alias( + name = "go_default_library", + actual = ":runtime", + visibility = ["//visibility:public"], +) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel new file mode 100644 index 000000000000..b89409465773 --- /dev/null +++ b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel @@ -0,0 +1,31 @@ +load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") + +package(default_visibility = ["//visibility:public"]) + +go_library( + name = "utilities", + srcs = [ + "doc.go", + "pattern.go", + "readerfactory.go", + "string_array_flag.go", + "trie.go", + ], + importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/utilities", +) + +go_test( + name = "utilities_test", + size = "small", + srcs = [ + "string_array_flag_test.go", + "trie_test.go", + ], + deps = [":utilities"], +) + +alias( + name = "go_default_library", + actual = ":utilities", + visibility = ["//visibility:public"], +) diff --git a/vendor/google.golang.org/grpc/test/bufconn/bufconn.go b/vendor/google.golang.org/grpc/test/bufconn/bufconn.go new file mode 100644 index 000000000000..3f77f4876eb8 --- /dev/null +++ b/vendor/google.golang.org/grpc/test/bufconn/bufconn.go @@ -0,0 +1,318 @@ +/* + * + * Copyright 2017 gRPC authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +// Package bufconn provides a net.Conn implemented by a buffer and related +// dialing and listening functionality. +package bufconn + +import ( + "context" + "fmt" + "io" + "net" + "sync" + "time" +) + +// Listener implements a net.Listener that creates local, buffered net.Conns +// via its Accept and Dial method. +type Listener struct { + mu sync.Mutex + sz int + ch chan net.Conn + done chan struct{} +} + +// Implementation of net.Error providing timeout +type netErrorTimeout struct { + error +} + +func (e netErrorTimeout) Timeout() bool { return true } +func (e netErrorTimeout) Temporary() bool { return false } + +var errClosed = fmt.Errorf("closed") +var errTimeout net.Error = netErrorTimeout{error: fmt.Errorf("i/o timeout")} + +// Listen returns a Listener that can only be contacted by its own Dialers and +// creates buffered connections between the two. +func Listen(sz int) *Listener { + return &Listener{sz: sz, ch: make(chan net.Conn), done: make(chan struct{})} +} + +// Accept blocks until Dial is called, then returns a net.Conn for the server +// half of the connection. +func (l *Listener) Accept() (net.Conn, error) { + select { + case <-l.done: + return nil, errClosed + case c := <-l.ch: + return c, nil + } +} + +// Close stops the listener. +func (l *Listener) Close() error { + l.mu.Lock() + defer l.mu.Unlock() + select { + case <-l.done: + // Already closed. + break + default: + close(l.done) + } + return nil +} + +// Addr reports the address of the listener. +func (l *Listener) Addr() net.Addr { return addr{} } + +// Dial creates an in-memory full-duplex network connection, unblocks Accept by +// providing it the server half of the connection, and returns the client half +// of the connection. +func (l *Listener) Dial() (net.Conn, error) { + return l.DialContext(context.Background()) +} + +// DialContext creates an in-memory full-duplex network connection, unblocks Accept by +// providing it the server half of the connection, and returns the client half +// of the connection. If ctx is Done, returns ctx.Err() +func (l *Listener) DialContext(ctx context.Context) (net.Conn, error) { + p1, p2 := newPipe(l.sz), newPipe(l.sz) + select { + case <-ctx.Done(): + return nil, ctx.Err() + case <-l.done: + return nil, errClosed + case l.ch <- &conn{p1, p2}: + return &conn{p2, p1}, nil + } +} + +type pipe struct { + mu sync.Mutex + + // buf contains the data in the pipe. It is a ring buffer of fixed capacity, + // with r and w pointing to the offset to read and write, respsectively. + // + // Data is read between [r, w) and written to [w, r), wrapping around the end + // of the slice if necessary. + // + // The buffer is empty if r == len(buf), otherwise if r == w, it is full. + // + // w and r are always in the range [0, cap(buf)) and [0, len(buf)]. + buf []byte + w, r int + + wwait sync.Cond + rwait sync.Cond + + // Indicate that a write/read timeout has occurred + wtimedout bool + rtimedout bool + + wtimer *time.Timer + rtimer *time.Timer + + closed bool + writeClosed bool +} + +func newPipe(sz int) *pipe { + p := &pipe{buf: make([]byte, 0, sz)} + p.wwait.L = &p.mu + p.rwait.L = &p.mu + + p.wtimer = time.AfterFunc(0, func() {}) + p.rtimer = time.AfterFunc(0, func() {}) + return p +} + +func (p *pipe) empty() bool { + return p.r == len(p.buf) +} + +func (p *pipe) full() bool { + return p.r < len(p.buf) && p.r == p.w +} + +func (p *pipe) Read(b []byte) (n int, err error) { + p.mu.Lock() + defer p.mu.Unlock() + // Block until p has data. + for { + if p.closed { + return 0, io.ErrClosedPipe + } + if !p.empty() { + break + } + if p.writeClosed { + return 0, io.EOF + } + if p.rtimedout { + return 0, errTimeout + } + + p.rwait.Wait() + } + wasFull := p.full() + + n = copy(b, p.buf[p.r:len(p.buf)]) + p.r += n + if p.r == cap(p.buf) { + p.r = 0 + p.buf = p.buf[:p.w] + } + + // Signal a blocked writer, if any + if wasFull { + p.wwait.Signal() + } + + return n, nil +} + +func (p *pipe) Write(b []byte) (n int, err error) { + p.mu.Lock() + defer p.mu.Unlock() + if p.closed { + return 0, io.ErrClosedPipe + } + for len(b) > 0 { + // Block until p is not full. + for { + if p.closed || p.writeClosed { + return 0, io.ErrClosedPipe + } + if !p.full() { + break + } + if p.wtimedout { + return 0, errTimeout + } + + p.wwait.Wait() + } + wasEmpty := p.empty() + + end := cap(p.buf) + if p.w < p.r { + end = p.r + } + x := copy(p.buf[p.w:end], b) + b = b[x:] + n += x + p.w += x + if p.w > len(p.buf) { + p.buf = p.buf[:p.w] + } + if p.w == cap(p.buf) { + p.w = 0 + } + + // Signal a blocked reader, if any. + if wasEmpty { + p.rwait.Signal() + } + } + return n, nil +} + +func (p *pipe) Close() error { + p.mu.Lock() + defer p.mu.Unlock() + p.closed = true + // Signal all blocked readers and writers to return an error. + p.rwait.Broadcast() + p.wwait.Broadcast() + return nil +} + +func (p *pipe) closeWrite() error { + p.mu.Lock() + defer p.mu.Unlock() + p.writeClosed = true + // Signal all blocked readers and writers to return an error. + p.rwait.Broadcast() + p.wwait.Broadcast() + return nil +} + +type conn struct { + io.Reader + io.Writer +} + +func (c *conn) Close() error { + err1 := c.Reader.(*pipe).Close() + err2 := c.Writer.(*pipe).closeWrite() + if err1 != nil { + return err1 + } + return err2 +} + +func (c *conn) SetDeadline(t time.Time) error { + c.SetReadDeadline(t) + c.SetWriteDeadline(t) + return nil +} + +func (c *conn) SetReadDeadline(t time.Time) error { + p := c.Reader.(*pipe) + p.mu.Lock() + defer p.mu.Unlock() + p.rtimer.Stop() + p.rtimedout = false + if !t.IsZero() { + p.rtimer = time.AfterFunc(time.Until(t), func() { + p.mu.Lock() + defer p.mu.Unlock() + p.rtimedout = true + p.rwait.Broadcast() + }) + } + return nil +} + +func (c *conn) SetWriteDeadline(t time.Time) error { + p := c.Writer.(*pipe) + p.mu.Lock() + defer p.mu.Unlock() + p.wtimer.Stop() + p.wtimedout = false + if !t.IsZero() { + p.wtimer = time.AfterFunc(time.Until(t), func() { + p.mu.Lock() + defer p.mu.Unlock() + p.wtimedout = true + p.wwait.Broadcast() + }) + } + return nil +} + +func (*conn) LocalAddr() net.Addr { return addr{} } +func (*conn) RemoteAddr() net.Addr { return addr{} } + +type addr struct{} + +func (addr) Network() string { return "bufconn" } +func (addr) String() string { return "bufconn" } diff --git a/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS b/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS new file mode 100644 index 000000000000..155648acb6df --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS @@ -0,0 +1,17 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - thockin + - lavalamp + - smarterclayton + - wojtek-t + - deads2k + - derekwaynecarr + - caesarxuchao + - mikedanese + - liggitt + - saad-ali + - janetkuo + - tallclair + - dims + - cjcullen diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS b/vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS new file mode 100644 index 000000000000..1e1330fff279 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS @@ -0,0 +1,14 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - thockin + - smarterclayton + - wojtek-t + - deads2k + - derekwaynecarr + - caesarxuchao + - mikedanese + - liggitt + - janetkuo + - ncdc + - dims diff --git a/vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS b/vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS new file mode 100644 index 000000000000..d1c9f53074d5 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS @@ -0,0 +1,11 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - thockin + - lavalamp + - smarterclayton + - wojtek-t + - derekwaynecarr + - mikedanese + - saad-ali + - janetkuo diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS new file mode 100644 index 000000000000..e7e5c152d0b7 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS @@ -0,0 +1,16 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - thockin + - smarterclayton + - wojtek-t + - deads2k + - caesarxuchao + - liggitt + - sttts + - luxas + - janetkuo + - justinsb + - ncdc + - soltysh + - dims diff --git a/vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS b/vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS new file mode 100644 index 000000000000..349bc69d6582 --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS @@ -0,0 +1,6 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - pwittrock +reviewers: + - apelisse diff --git a/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS b/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS new file mode 100644 index 000000000000..4443bafd137b --- /dev/null +++ b/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS @@ -0,0 +1,8 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - pwittrock +reviewers: + - apelisse +emeritus_approvers: + - mengqiy diff --git a/vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS b/vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS new file mode 100644 index 000000000000..349bc69d6582 --- /dev/null +++ b/vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS @@ -0,0 +1,6 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - pwittrock +reviewers: + - apelisse diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS new file mode 100644 index 000000000000..4dfbb98aec85 --- /dev/null +++ b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS @@ -0,0 +1,8 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +# approval on api packages bubbles to api-approvers +reviewers: + - sig-auth-authenticators-approvers + - sig-auth-authenticators-reviewers +labels: + - sig/auth diff --git a/vendor/k8s.io/client-go/rest/OWNERS b/vendor/k8s.io/client-go/rest/OWNERS new file mode 100644 index 000000000000..7b23294c45e5 --- /dev/null +++ b/vendor/k8s.io/client-go/rest/OWNERS @@ -0,0 +1,14 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - thockin + - smarterclayton + - caesarxuchao + - wojtek-t + - deads2k + - liggitt + - sttts + - luxas + - dims + - cjcullen + - lojies diff --git a/vendor/k8s.io/client-go/tools/auth/OWNERS b/vendor/k8s.io/client-go/tools/auth/OWNERS new file mode 100644 index 000000000000..c4ea6463df4d --- /dev/null +++ b/vendor/k8s.io/client-go/tools/auth/OWNERS @@ -0,0 +1,8 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - sig-auth-authenticators-approvers +reviewers: + - sig-auth-authenticators-reviewers +labels: + - sig/auth diff --git a/vendor/k8s.io/client-go/tools/cache/OWNERS b/vendor/k8s.io/client-go/tools/cache/OWNERS new file mode 100644 index 000000000000..726205b3dff3 --- /dev/null +++ b/vendor/k8s.io/client-go/tools/cache/OWNERS @@ -0,0 +1,28 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - thockin + - lavalamp + - smarterclayton + - wojtek-t + - deads2k + - caesarxuchao + - liggitt + - ncdc +reviewers: + - thockin + - lavalamp + - smarterclayton + - wojtek-t + - deads2k + - derekwaynecarr + - caesarxuchao + - mikedanese + - liggitt + - janetkuo + - justinsb + - soltysh + - jsafrane + - dims + - ingvagabund + - ncdc diff --git a/vendor/k8s.io/client-go/tools/leaderelection/OWNERS b/vendor/k8s.io/client-go/tools/leaderelection/OWNERS new file mode 100644 index 000000000000..908bdacdfeec --- /dev/null +++ b/vendor/k8s.io/client-go/tools/leaderelection/OWNERS @@ -0,0 +1,11 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - mikedanese +reviewers: + - wojtek-t + - deads2k + - mikedanese + - ingvagabund +emeritus_approvers: + - timothysc diff --git a/vendor/k8s.io/client-go/tools/metrics/OWNERS b/vendor/k8s.io/client-go/tools/metrics/OWNERS new file mode 100644 index 000000000000..2c9488a5fb2c --- /dev/null +++ b/vendor/k8s.io/client-go/tools/metrics/OWNERS @@ -0,0 +1,5 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - wojtek-t + - jayunit100 diff --git a/vendor/k8s.io/client-go/tools/record/OWNERS b/vendor/k8s.io/client-go/tools/record/OWNERS new file mode 100644 index 000000000000..8105c4fe087c --- /dev/null +++ b/vendor/k8s.io/client-go/tools/record/OWNERS @@ -0,0 +1,6 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - sig-instrumentation-reviewers +approvers: + - sig-instrumentation-approvers diff --git a/vendor/k8s.io/client-go/transport/OWNERS b/vendor/k8s.io/client-go/transport/OWNERS new file mode 100644 index 000000000000..34adee5ec539 --- /dev/null +++ b/vendor/k8s.io/client-go/transport/OWNERS @@ -0,0 +1,8 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - smarterclayton + - wojtek-t + - deads2k + - liggitt + - caesarxuchao diff --git a/vendor/k8s.io/client-go/util/cert/OWNERS b/vendor/k8s.io/client-go/util/cert/OWNERS new file mode 100644 index 000000000000..3c3b94c58c3f --- /dev/null +++ b/vendor/k8s.io/client-go/util/cert/OWNERS @@ -0,0 +1,8 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - sig-auth-certificates-approvers +reviewers: + - sig-auth-certificates-reviewers +labels: + - sig/auth diff --git a/vendor/k8s.io/client-go/util/keyutil/OWNERS b/vendor/k8s.io/client-go/util/keyutil/OWNERS new file mode 100644 index 000000000000..e6d229d5dbe1 --- /dev/null +++ b/vendor/k8s.io/client-go/util/keyutil/OWNERS @@ -0,0 +1,6 @@ +approvers: + - sig-auth-certificates-approvers +reviewers: + - sig-auth-certificates-reviewers +labels: + - sig/auth diff --git a/vendor/k8s.io/client-go/util/retry/OWNERS b/vendor/k8s.io/client-go/util/retry/OWNERS new file mode 100644 index 000000000000..75736b5aace8 --- /dev/null +++ b/vendor/k8s.io/client-go/util/retry/OWNERS @@ -0,0 +1,4 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +reviewers: + - caesarxuchao diff --git a/vendor/k8s.io/code-generator/OWNERS b/vendor/k8s.io/code-generator/OWNERS new file mode 100644 index 000000000000..c59502195b90 --- /dev/null +++ b/vendor/k8s.io/code-generator/OWNERS @@ -0,0 +1,13 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - lavalamp + - wojtek-t + - sttts +reviewers: + - lavalamp + - wojtek-t + - sttts +labels: + - sig/api-machinery + - area/code-generation diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS b/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS new file mode 100644 index 000000000000..0170a84e8a95 --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS @@ -0,0 +1,10 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - lavalamp + - wojtek-t + - caesarxuchao +reviewers: + - lavalamp + - wojtek-t + - caesarxuchao diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS new file mode 100644 index 000000000000..af7e2ec4c7d3 --- /dev/null +++ b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS @@ -0,0 +1,6 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - smarterclayton +reviewers: + - smarterclayton diff --git a/vendor/k8s.io/klog/OWNERS b/vendor/k8s.io/klog/OWNERS new file mode 100644 index 000000000000..380e514f2807 --- /dev/null +++ b/vendor/k8s.io/klog/OWNERS @@ -0,0 +1,19 @@ +# See the OWNERS docs at https://go.k8s.io/owners +reviewers: + - jayunit100 + - hoegaarden + - andyxning + - neolit123 + - pohly + - yagonobre + - vincepri + - detiber +approvers: + - dims + - thockin + - justinsb + - tallclair + - piosz + - brancz + - DirectXMan12 + - lavalamp diff --git a/vendor/k8s.io/klog/v2/OWNERS b/vendor/k8s.io/klog/v2/OWNERS new file mode 100644 index 000000000000..a2fe8f351bf2 --- /dev/null +++ b/vendor/k8s.io/klog/v2/OWNERS @@ -0,0 +1,14 @@ +# See the OWNERS docs at https://go.k8s.io/owners +reviewers: + - harshanarayana + - pohly +approvers: + - dims + - thockin + - serathius +emeritus_approvers: + - brancz + - justinsb + - lavalamp + - piosz + - tallclair diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS b/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS new file mode 100644 index 000000000000..235bc545b88b --- /dev/null +++ b/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS @@ -0,0 +1,4 @@ +reviewers: +- roycaihw +approvers: +- roycaihw diff --git a/vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS b/vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS new file mode 100644 index 000000000000..9621a6a3a4ac --- /dev/null +++ b/vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS @@ -0,0 +1,2 @@ +approvers: +- apelisse diff --git a/vendor/k8s.io/utils/pointer/OWNERS b/vendor/k8s.io/utils/pointer/OWNERS new file mode 100644 index 000000000000..0d6392752af2 --- /dev/null +++ b/vendor/k8s.io/utils/pointer/OWNERS @@ -0,0 +1,10 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: +- apelisse +- stewart-yu +- thockin +reviewers: +- apelisse +- stewart-yu +- thockin diff --git a/vendor/knative.dev/hack/OWNERS b/vendor/knative.dev/hack/OWNERS new file mode 100644 index 000000000000..4d20bf8cffef --- /dev/null +++ b/vendor/knative.dev/hack/OWNERS @@ -0,0 +1,8 @@ +approvers: + - technical-oversight-committee + - productivity-writers + - knative-release-leads + +reviewers: + - productivity-writers + - productivity-reviewers diff --git a/vendor/knative.dev/hack/OWNERS_ALIASES b/vendor/knative.dev/hack/OWNERS_ALIASES new file mode 100644 index 000000000000..103ef9259116 --- /dev/null +++ b/vendor/knative.dev/hack/OWNERS_ALIASES @@ -0,0 +1,168 @@ +# This file is auto-generated from peribolos. +# Do not modify this file, instead modify peribolos/knative.yaml + +aliases: + client-reviewers: + - itsmurugappan + client-wg-leads: + - dsimansk + - navidshaikh + - rhuss + client-writers: + - dsimansk + - maximilien + - navidshaikh + - rhuss + - vyasgun + conformance-task-force-leads: + - salaboy + conformance-writers: + - salaboy + docs-reviewers: + - nainaz + - pmbanugo + - snneji + docs-wg-leads: + - snneji + docs-writers: + - csantanapr + - psschwei + - snneji + eventing-reviewers: + - aslom + - creydr + eventing-triage: + - lberk + eventing-wg-leads: + - pierDipi + eventing-writers: + - aliok + - lberk + - lionelvillard + - matzew + - odacremolbap + - pierDipi + func-reviewers: + - jrangelramos + - nainaz + func-writers: + - jrangelramos + - lance + - lkingland + - matejvasek + - salaboy + - zroubalik + functions-wg-leads: + - lance + - salaboy + knative-admin: + - Vishal-Chdhry + - creydr + - csantanapr + - dprotaso + - dsimansk + - evankanderson + - knative-automation + - knative-prow-releaser-robot + - knative-prow-robot + - knative-prow-updater-robot + - knative-test-reporter-robot + - kvmware + - lance + - mchmarny + - nainaz + - pierDipi + - psschwei + - puerco + - salaboy + - skonto + - smoser-ibm + - upodroid + - zroubalik + knative-release-leads: + - Vishal-Chdhry + - creydr + - dsimansk + - pierDipi + - skonto + knative-robots: + - knative-automation + - knative-prow-releaser-robot + - knative-prow-robot + - knative-prow-updater-robot + - knative-test-reporter-robot + operations-reviewers: + - aliok + - houshengbo + - matzew + - maximilien + operations-wg-leads: + - houshengbo + operations-writers: + - aliok + - houshengbo + - matzew + - maximilien + productivity-leads: + - kvmware + - upodroid + productivity-reviewers: + - evankanderson + - mgencur + productivity-wg-leads: + - kvmware + - upodroid + productivity-writers: + - cardil + - kvmware + - psschwei + - upodroid + security-wg-leads: + - davidhadas + - evankanderson + security-writers: + - davidhadas + - evankanderson + serving-approvers: + - nak3 + - skonto + serving-reviewers: + - KauzClay + - jsanin-vmw + - kauana + - kvmware + - retocode + - skonto + - xtreme-vikram-yadav + serving-triage: + - KauzClay + - retocode + - skonto + serving-wg-leads: + - dprotaso + - psschwei + serving-writers: + - dprotaso + - nak3 + - psschwei + - skonto + steering-committee: + - csantanapr + - lance + - nainaz + - puerco + - salaboy + technical-oversight-committee: + - dprotaso + - dsimansk + - kvmware + - psschwei + - zroubalik + trademark-committee: + - evankanderson + - mchmarny + - smoser-ibm + ux-wg-leads: + - snneji + ux-writers: + - snneji diff --git a/vendor/knative.dev/pkg/apis/OWNERS b/vendor/knative.dev/pkg/apis/OWNERS new file mode 100644 index 000000000000..13014203fc86 --- /dev/null +++ b/vendor/knative.dev/pkg/apis/OWNERS @@ -0,0 +1,15 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- technical-oversight-committee +- serving-wg-leads +- eventing-wg-leads + +reviewers: +- serving-writers +- eventing-writers +- eventing-reviewers +- serving-reviewers + +options: + no_parent_owners: true diff --git a/vendor/knative.dev/pkg/apis/duck/OWNERS b/vendor/knative.dev/pkg/apis/duck/OWNERS new file mode 100644 index 000000000000..af1eb05dac49 --- /dev/null +++ b/vendor/knative.dev/pkg/apis/duck/OWNERS @@ -0,0 +1,8 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- eventing-wg-leads + +reviewers: +- eventing-reviewers +- eventing-writers diff --git a/vendor/knative.dev/pkg/controller/OWNERS b/vendor/knative.dev/pkg/controller/OWNERS new file mode 100644 index 000000000000..64660c9e35d3 --- /dev/null +++ b/vendor/knative.dev/pkg/controller/OWNERS @@ -0,0 +1,7 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- serving-writers + +reviewers: +- serving-reviewers diff --git a/vendor/knative.dev/pkg/hack/OWNERS b/vendor/knative.dev/pkg/hack/OWNERS new file mode 100644 index 000000000000..65aa9e7b118e --- /dev/null +++ b/vendor/knative.dev/pkg/hack/OWNERS @@ -0,0 +1,10 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- productivity-writers + +reviewers: +- productivity-reviewers + +labels: +- area/test-and-release diff --git a/vendor/knative.dev/pkg/reconciler/OWNERS b/vendor/knative.dev/pkg/reconciler/OWNERS new file mode 100644 index 000000000000..136197a30305 --- /dev/null +++ b/vendor/knative.dev/pkg/reconciler/OWNERS @@ -0,0 +1,7 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- serving-writers + +reviewers: +- serving-writers diff --git a/vendor/knative.dev/pkg/resolver/OWNERS b/vendor/knative.dev/pkg/resolver/OWNERS new file mode 100644 index 000000000000..b5e9581f4ed0 --- /dev/null +++ b/vendor/knative.dev/pkg/resolver/OWNERS @@ -0,0 +1,8 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- eventing-writers + +reviewers: +- eventing-reviewers + diff --git a/vendor/knative.dev/pkg/test/OWNERS b/vendor/knative.dev/pkg/test/OWNERS new file mode 100644 index 000000000000..65aa9e7b118e --- /dev/null +++ b/vendor/knative.dev/pkg/test/OWNERS @@ -0,0 +1,10 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- productivity-writers + +reviewers: +- productivity-reviewers + +labels: +- area/test-and-release diff --git a/vendor/knative.dev/pkg/webhook/OWNERS b/vendor/knative.dev/pkg/webhook/OWNERS new file mode 100644 index 000000000000..64660c9e35d3 --- /dev/null +++ b/vendor/knative.dev/pkg/webhook/OWNERS @@ -0,0 +1,7 @@ +# The OWNERS file is used by prow to automatically merge approved PRs. + +approvers: +- serving-writers + +reviewers: +- serving-reviewers diff --git a/vendor/modules.txt b/vendor/modules.txt index dcdf780ea14a..53d2947882eb 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -741,6 +741,7 @@ google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap +google.golang.org/grpc/test/bufconn # google.golang.org/protobuf v1.31.0 ## explicit; go 1.11 google.golang.org/protobuf/encoding/protojson diff --git a/vendor/sigs.k8s.io/json/OWNERS b/vendor/sigs.k8s.io/json/OWNERS new file mode 100644 index 000000000000..0fadafbddbfd --- /dev/null +++ b/vendor/sigs.k8s.io/json/OWNERS @@ -0,0 +1,6 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: + - deads2k + - lavalamp + - liggitt diff --git a/vendor/sigs.k8s.io/yaml/OWNERS b/vendor/sigs.k8s.io/yaml/OWNERS new file mode 100644 index 000000000000..325b40b0763f --- /dev/null +++ b/vendor/sigs.k8s.io/yaml/OWNERS @@ -0,0 +1,27 @@ +# See the OWNERS docs at https://go.k8s.io/owners + +approvers: +- dims +- lavalamp +- smarterclayton +- deads2k +- sttts +- liggitt +- caesarxuchao +reviewers: +- dims +- thockin +- lavalamp +- smarterclayton +- wojtek-t +- deads2k +- derekwaynecarr +- caesarxuchao +- mikedanese +- liggitt +- gmarek +- sttts +- ncdc +- tallclair +labels: +- sig/api-machinery From b3764889d9b63f3290ee03269a52185014584a68 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Sun, 16 Jul 2023 16:59:36 +0900 Subject: [PATCH 11/18] Add test in readiness/probe_test.go --- pkg/queue/readiness/probe_test.go | 56 +++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/pkg/queue/readiness/probe_test.go b/pkg/queue/readiness/probe_test.go index 6b67c1ec0922..2a058ef881c6 100644 --- a/pkg/queue/readiness/probe_test.go +++ b/pkg/queue/readiness/probe_test.go @@ -18,8 +18,11 @@ package readiness import ( "bytes" + "context" "errors" "fmt" + "google.golang.org/grpc" + "google.golang.org/grpc/health/grpc_health_v1" "net" "net/http" "net/http/httptest" @@ -655,6 +658,30 @@ func TestKnTCPProbeSuccessThresholdIncludesFailure(t *testing.T) { } } +func TestGRPCSuccess(t *testing.T) { + port := 12345 + if err := newTestGRPCServer(t, port); err != nil { + t.Errorf("Failed to create test grpc server: %v", err) + } + + pb := NewProbe(&corev1.Probe{ + PeriodSeconds: 1, + TimeoutSeconds: 5, + SuccessThreshold: 1, + FailureThreshold: 1, + ProbeHandler: corev1.ProbeHandler{ + GRPC: &corev1.GRPCAction{ + Port: int32(port), + Service: nil, + }, + }, + }) + + if !pb.ProbeContainer() { + t.Error("Probe failed. Expected success.") + } +} + func newTestServer(t *testing.T, h http.HandlerFunc) *url.URL { t.Helper() @@ -668,3 +695,32 @@ func newTestServer(t *testing.T, h http.HandlerFunc) *url.URL { return u } + +func newTestGRPCServer(t *testing.T, port int) error { + t.Helper() + grpcAddr := fmt.Sprintf("127.0.0.1:%d", port) + lis, err := net.Listen("tcp", grpcAddr) + if err != nil { + t.Fatalf("failed to listen: %v", err) + } + + s := grpc.NewServer() + grpc_health_v1.RegisterHealthServer(s, &grpcHealthServer{}) + + go func() { + if err := s.Serve(lis); err != nil { + t.Fatalf("Failed to run gRPC test server %v", err) + } + }() + t.Cleanup(s.Stop) + + return nil +} + +type grpcHealthServer struct { + grpc_health_v1.UnimplementedHealthServer +} + +func (s *grpcHealthServer) Check(_ context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error) { + return &grpc_health_v1.HealthCheckResponse{Status: grpc_health_v1.HealthCheckResponse_SERVING}, nil +} From a9e99efc4a2da5a1ad595b4d1e41e85dd3e8d735 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Fri, 21 Jul 2023 00:22:29 +0900 Subject: [PATCH 12/18] update deps --- .../google/mako/go/quickstore/BUILD | 24 -- .../google/mako/internal/go/common/BUILD | 14 - .../v2/internal/httprule/BUILD.bazel | 35 -- .../grpc-gateway/v2/runtime/BUILD.bazel | 97 ------ .../grpc-gateway/v2/utilities/BUILD.bazel | 31 -- .../grpc/test/bufconn/bufconn.go | 318 ------------------ .../k8s.io/apimachinery/pkg/api/errors/OWNERS | 17 - .../k8s.io/apimachinery/pkg/api/meta/OWNERS | 14 - .../apimachinery/pkg/api/resource/OWNERS | 11 - .../apimachinery/pkg/apis/meta/v1/OWNERS | 16 - .../apimachinery/pkg/util/mergepatch/OWNERS | 6 - .../pkg/util/strategicpatch/OWNERS | 8 - .../third_party/forked/golang/json/OWNERS | 6 - .../pkg/apis/clientauthentication/OWNERS | 8 - vendor/k8s.io/client-go/rest/OWNERS | 14 - vendor/k8s.io/client-go/tools/auth/OWNERS | 8 - vendor/k8s.io/client-go/tools/cache/OWNERS | 28 -- .../client-go/tools/leaderelection/OWNERS | 11 - vendor/k8s.io/client-go/tools/metrics/OWNERS | 5 - vendor/k8s.io/client-go/tools/record/OWNERS | 6 - vendor/k8s.io/client-go/transport/OWNERS | 8 - vendor/k8s.io/client-go/util/cert/OWNERS | 8 - vendor/k8s.io/client-go/util/keyutil/OWNERS | 6 - vendor/k8s.io/client-go/util/retry/OWNERS | 4 - vendor/k8s.io/code-generator/OWNERS | 13 - .../code-generator/cmd/client-gen/OWNERS | 10 - .../code-generator/cmd/go-to-protobuf/OWNERS | 6 - vendor/k8s.io/klog/OWNERS | 19 -- vendor/k8s.io/klog/v2/OWNERS | 14 - .../kube-openapi/pkg/generators/rules/OWNERS | 4 - .../k8s.io/kube-openapi/pkg/util/proto/OWNERS | 2 - vendor/k8s.io/utils/pointer/OWNERS | 10 - vendor/knative.dev/hack/OWNERS | 8 - vendor/knative.dev/hack/OWNERS_ALIASES | 168 --------- vendor/knative.dev/pkg/apis/OWNERS | 15 - vendor/knative.dev/pkg/apis/duck/OWNERS | 8 - vendor/knative.dev/pkg/controller/OWNERS | 7 - vendor/knative.dev/pkg/hack/OWNERS | 10 - vendor/knative.dev/pkg/reconciler/OWNERS | 7 - vendor/knative.dev/pkg/resolver/OWNERS | 8 - vendor/knative.dev/pkg/test/OWNERS | 10 - vendor/knative.dev/pkg/webhook/OWNERS | 7 - vendor/modules.txt | 1 - vendor/sigs.k8s.io/json/OWNERS | 6 - vendor/sigs.k8s.io/yaml/OWNERS | 27 -- 45 files changed, 1063 deletions(-) delete mode 100644 vendor/github.com/google/mako/go/quickstore/BUILD delete mode 100644 vendor/github.com/google/mako/internal/go/common/BUILD delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel delete mode 100644 vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel delete mode 100644 vendor/google.golang.org/grpc/test/bufconn/bufconn.go delete mode 100644 vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS delete mode 100644 vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS delete mode 100644 vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS delete mode 100644 vendor/k8s.io/client-go/rest/OWNERS delete mode 100644 vendor/k8s.io/client-go/tools/auth/OWNERS delete mode 100644 vendor/k8s.io/client-go/tools/cache/OWNERS delete mode 100644 vendor/k8s.io/client-go/tools/leaderelection/OWNERS delete mode 100644 vendor/k8s.io/client-go/tools/metrics/OWNERS delete mode 100644 vendor/k8s.io/client-go/tools/record/OWNERS delete mode 100644 vendor/k8s.io/client-go/transport/OWNERS delete mode 100644 vendor/k8s.io/client-go/util/cert/OWNERS delete mode 100644 vendor/k8s.io/client-go/util/keyutil/OWNERS delete mode 100644 vendor/k8s.io/client-go/util/retry/OWNERS delete mode 100644 vendor/k8s.io/code-generator/OWNERS delete mode 100644 vendor/k8s.io/code-generator/cmd/client-gen/OWNERS delete mode 100644 vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS delete mode 100644 vendor/k8s.io/klog/OWNERS delete mode 100644 vendor/k8s.io/klog/v2/OWNERS delete mode 100644 vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS delete mode 100644 vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS delete mode 100644 vendor/k8s.io/utils/pointer/OWNERS delete mode 100644 vendor/knative.dev/hack/OWNERS delete mode 100644 vendor/knative.dev/hack/OWNERS_ALIASES delete mode 100644 vendor/knative.dev/pkg/apis/OWNERS delete mode 100644 vendor/knative.dev/pkg/apis/duck/OWNERS delete mode 100644 vendor/knative.dev/pkg/controller/OWNERS delete mode 100644 vendor/knative.dev/pkg/hack/OWNERS delete mode 100644 vendor/knative.dev/pkg/reconciler/OWNERS delete mode 100644 vendor/knative.dev/pkg/resolver/OWNERS delete mode 100644 vendor/knative.dev/pkg/test/OWNERS delete mode 100644 vendor/knative.dev/pkg/webhook/OWNERS delete mode 100644 vendor/sigs.k8s.io/json/OWNERS delete mode 100644 vendor/sigs.k8s.io/yaml/OWNERS diff --git a/vendor/github.com/google/mako/go/quickstore/BUILD b/vendor/github.com/google/mako/go/quickstore/BUILD deleted file mode 100644 index 4623b68eadea..000000000000 --- a/vendor/github.com/google/mako/go/quickstore/BUILD +++ /dev/null @@ -1,24 +0,0 @@ -# Quickstore library for Go. -# See quickstore.go and go/mako-quickstore for documentation. -# See quickstore_example_test.go for example usage. -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) - -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -go_library( - name = "quickstore", - srcs = ["quickstore.go"], - importpath = "github.com/google/mako/go/quickstore", - deps = [ - "//internal/go/common", - "//internal/quickstore_microservice/proto:quickstore_go_grpc_pb", - "//internal/quickstore_microservice/proto:quickstore_go_proto", - "//proto/quickstore:quickstore_go_proto", - "//spec/proto:mako_go_proto", - "@com_github_golang_glog//:go_default_library", - "@com_github_golang_protobuf//proto:go_default_library", - "@org_golang_google_grpc//:go_default_library", - ], -) diff --git a/vendor/github.com/google/mako/internal/go/common/BUILD b/vendor/github.com/google/mako/internal/go/common/BUILD deleted file mode 100644 index 1f90d9eda1e9..000000000000 --- a/vendor/github.com/google/mako/internal/go/common/BUILD +++ /dev/null @@ -1,14 +0,0 @@ -# Go libraries for mako -package(default_visibility = ["//:internal"]) - -licenses(["notice"]) - -load("@io_bazel_rules_go//go:def.bzl", "go_library") - -go_library( - name = "common", - srcs = [ - "common_deps.go", - ], - importpath = "github.com/google/mako/internal/go/common", -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel deleted file mode 100644 index f694f3c0d035..000000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule/BUILD.bazel +++ /dev/null @@ -1,35 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package(default_visibility = ["//visibility:public"]) - -go_library( - name = "httprule", - srcs = [ - "compile.go", - "parse.go", - "types.go", - ], - importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/internal/httprule", - deps = ["//utilities"], -) - -go_test( - name = "httprule_test", - size = "small", - srcs = [ - "compile_test.go", - "parse_test.go", - "types_test.go", - ], - embed = [":httprule"], - deps = [ - "//utilities", - "@com_github_golang_glog//:glog", - ], -) - -alias( - name = "go_default_library", - actual = ":httprule", - visibility = ["//:__subpackages__"], -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel deleted file mode 100644 index b5140a3c9d16..000000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/runtime/BUILD.bazel +++ /dev/null @@ -1,97 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package(default_visibility = ["//visibility:public"]) - -go_library( - name = "runtime", - srcs = [ - "context.go", - "convert.go", - "doc.go", - "errors.go", - "fieldmask.go", - "handler.go", - "marshal_httpbodyproto.go", - "marshal_json.go", - "marshal_jsonpb.go", - "marshal_proto.go", - "marshaler.go", - "marshaler_registry.go", - "mux.go", - "pattern.go", - "proto2_convert.go", - "query.go", - ], - importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/runtime", - deps = [ - "//internal/httprule", - "//utilities", - "@go_googleapis//google/api:httpbody_go_proto", - "@io_bazel_rules_go//proto/wkt:field_mask_go_proto", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//grpclog", - "@org_golang_google_grpc//health/grpc_health_v1", - "@org_golang_google_grpc//metadata", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//encoding/protojson", - "@org_golang_google_protobuf//proto", - "@org_golang_google_protobuf//reflect/protoreflect", - "@org_golang_google_protobuf//reflect/protoregistry", - "@org_golang_google_protobuf//types/known/durationpb", - "@org_golang_google_protobuf//types/known/structpb", - "@org_golang_google_protobuf//types/known/timestamppb", - "@org_golang_google_protobuf//types/known/wrapperspb", - ], -) - -go_test( - name = "runtime_test", - size = "small", - srcs = [ - "context_test.go", - "convert_test.go", - "errors_test.go", - "fieldmask_test.go", - "handler_test.go", - "marshal_httpbodyproto_test.go", - "marshal_json_test.go", - "marshal_jsonpb_test.go", - "marshal_proto_test.go", - "marshaler_registry_test.go", - "mux_internal_test.go", - "mux_test.go", - "pattern_test.go", - "query_fuzz_test.go", - "query_test.go", - ], - embed = [":runtime"], - deps = [ - "//runtime/internal/examplepb", - "//utilities", - "@com_github_google_go_cmp//cmp", - "@com_github_google_go_cmp//cmp/cmpopts", - "@go_googleapis//google/api:httpbody_go_proto", - "@go_googleapis//google/rpc:errdetails_go_proto", - "@go_googleapis//google/rpc:status_go_proto", - "@io_bazel_rules_go//proto/wkt:field_mask_go_proto", - "@org_golang_google_grpc//:go_default_library", - "@org_golang_google_grpc//codes", - "@org_golang_google_grpc//health/grpc_health_v1", - "@org_golang_google_grpc//metadata", - "@org_golang_google_grpc//status", - "@org_golang_google_protobuf//encoding/protojson", - "@org_golang_google_protobuf//proto", - "@org_golang_google_protobuf//testing/protocmp", - "@org_golang_google_protobuf//types/known/durationpb", - "@org_golang_google_protobuf//types/known/emptypb", - "@org_golang_google_protobuf//types/known/structpb", - "@org_golang_google_protobuf//types/known/timestamppb", - "@org_golang_google_protobuf//types/known/wrapperspb", - ], -) - -alias( - name = "go_default_library", - actual = ":runtime", - visibility = ["//visibility:public"], -) diff --git a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel b/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel deleted file mode 100644 index b89409465773..000000000000 --- a/vendor/github.com/grpc-ecosystem/grpc-gateway/v2/utilities/BUILD.bazel +++ /dev/null @@ -1,31 +0,0 @@ -load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") - -package(default_visibility = ["//visibility:public"]) - -go_library( - name = "utilities", - srcs = [ - "doc.go", - "pattern.go", - "readerfactory.go", - "string_array_flag.go", - "trie.go", - ], - importpath = "github.com/grpc-ecosystem/grpc-gateway/v2/utilities", -) - -go_test( - name = "utilities_test", - size = "small", - srcs = [ - "string_array_flag_test.go", - "trie_test.go", - ], - deps = [":utilities"], -) - -alias( - name = "go_default_library", - actual = ":utilities", - visibility = ["//visibility:public"], -) diff --git a/vendor/google.golang.org/grpc/test/bufconn/bufconn.go b/vendor/google.golang.org/grpc/test/bufconn/bufconn.go deleted file mode 100644 index 3f77f4876eb8..000000000000 --- a/vendor/google.golang.org/grpc/test/bufconn/bufconn.go +++ /dev/null @@ -1,318 +0,0 @@ -/* - * - * Copyright 2017 gRPC authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - */ - -// Package bufconn provides a net.Conn implemented by a buffer and related -// dialing and listening functionality. -package bufconn - -import ( - "context" - "fmt" - "io" - "net" - "sync" - "time" -) - -// Listener implements a net.Listener that creates local, buffered net.Conns -// via its Accept and Dial method. -type Listener struct { - mu sync.Mutex - sz int - ch chan net.Conn - done chan struct{} -} - -// Implementation of net.Error providing timeout -type netErrorTimeout struct { - error -} - -func (e netErrorTimeout) Timeout() bool { return true } -func (e netErrorTimeout) Temporary() bool { return false } - -var errClosed = fmt.Errorf("closed") -var errTimeout net.Error = netErrorTimeout{error: fmt.Errorf("i/o timeout")} - -// Listen returns a Listener that can only be contacted by its own Dialers and -// creates buffered connections between the two. -func Listen(sz int) *Listener { - return &Listener{sz: sz, ch: make(chan net.Conn), done: make(chan struct{})} -} - -// Accept blocks until Dial is called, then returns a net.Conn for the server -// half of the connection. -func (l *Listener) Accept() (net.Conn, error) { - select { - case <-l.done: - return nil, errClosed - case c := <-l.ch: - return c, nil - } -} - -// Close stops the listener. -func (l *Listener) Close() error { - l.mu.Lock() - defer l.mu.Unlock() - select { - case <-l.done: - // Already closed. - break - default: - close(l.done) - } - return nil -} - -// Addr reports the address of the listener. -func (l *Listener) Addr() net.Addr { return addr{} } - -// Dial creates an in-memory full-duplex network connection, unblocks Accept by -// providing it the server half of the connection, and returns the client half -// of the connection. -func (l *Listener) Dial() (net.Conn, error) { - return l.DialContext(context.Background()) -} - -// DialContext creates an in-memory full-duplex network connection, unblocks Accept by -// providing it the server half of the connection, and returns the client half -// of the connection. If ctx is Done, returns ctx.Err() -func (l *Listener) DialContext(ctx context.Context) (net.Conn, error) { - p1, p2 := newPipe(l.sz), newPipe(l.sz) - select { - case <-ctx.Done(): - return nil, ctx.Err() - case <-l.done: - return nil, errClosed - case l.ch <- &conn{p1, p2}: - return &conn{p2, p1}, nil - } -} - -type pipe struct { - mu sync.Mutex - - // buf contains the data in the pipe. It is a ring buffer of fixed capacity, - // with r and w pointing to the offset to read and write, respsectively. - // - // Data is read between [r, w) and written to [w, r), wrapping around the end - // of the slice if necessary. - // - // The buffer is empty if r == len(buf), otherwise if r == w, it is full. - // - // w and r are always in the range [0, cap(buf)) and [0, len(buf)]. - buf []byte - w, r int - - wwait sync.Cond - rwait sync.Cond - - // Indicate that a write/read timeout has occurred - wtimedout bool - rtimedout bool - - wtimer *time.Timer - rtimer *time.Timer - - closed bool - writeClosed bool -} - -func newPipe(sz int) *pipe { - p := &pipe{buf: make([]byte, 0, sz)} - p.wwait.L = &p.mu - p.rwait.L = &p.mu - - p.wtimer = time.AfterFunc(0, func() {}) - p.rtimer = time.AfterFunc(0, func() {}) - return p -} - -func (p *pipe) empty() bool { - return p.r == len(p.buf) -} - -func (p *pipe) full() bool { - return p.r < len(p.buf) && p.r == p.w -} - -func (p *pipe) Read(b []byte) (n int, err error) { - p.mu.Lock() - defer p.mu.Unlock() - // Block until p has data. - for { - if p.closed { - return 0, io.ErrClosedPipe - } - if !p.empty() { - break - } - if p.writeClosed { - return 0, io.EOF - } - if p.rtimedout { - return 0, errTimeout - } - - p.rwait.Wait() - } - wasFull := p.full() - - n = copy(b, p.buf[p.r:len(p.buf)]) - p.r += n - if p.r == cap(p.buf) { - p.r = 0 - p.buf = p.buf[:p.w] - } - - // Signal a blocked writer, if any - if wasFull { - p.wwait.Signal() - } - - return n, nil -} - -func (p *pipe) Write(b []byte) (n int, err error) { - p.mu.Lock() - defer p.mu.Unlock() - if p.closed { - return 0, io.ErrClosedPipe - } - for len(b) > 0 { - // Block until p is not full. - for { - if p.closed || p.writeClosed { - return 0, io.ErrClosedPipe - } - if !p.full() { - break - } - if p.wtimedout { - return 0, errTimeout - } - - p.wwait.Wait() - } - wasEmpty := p.empty() - - end := cap(p.buf) - if p.w < p.r { - end = p.r - } - x := copy(p.buf[p.w:end], b) - b = b[x:] - n += x - p.w += x - if p.w > len(p.buf) { - p.buf = p.buf[:p.w] - } - if p.w == cap(p.buf) { - p.w = 0 - } - - // Signal a blocked reader, if any. - if wasEmpty { - p.rwait.Signal() - } - } - return n, nil -} - -func (p *pipe) Close() error { - p.mu.Lock() - defer p.mu.Unlock() - p.closed = true - // Signal all blocked readers and writers to return an error. - p.rwait.Broadcast() - p.wwait.Broadcast() - return nil -} - -func (p *pipe) closeWrite() error { - p.mu.Lock() - defer p.mu.Unlock() - p.writeClosed = true - // Signal all blocked readers and writers to return an error. - p.rwait.Broadcast() - p.wwait.Broadcast() - return nil -} - -type conn struct { - io.Reader - io.Writer -} - -func (c *conn) Close() error { - err1 := c.Reader.(*pipe).Close() - err2 := c.Writer.(*pipe).closeWrite() - if err1 != nil { - return err1 - } - return err2 -} - -func (c *conn) SetDeadline(t time.Time) error { - c.SetReadDeadline(t) - c.SetWriteDeadline(t) - return nil -} - -func (c *conn) SetReadDeadline(t time.Time) error { - p := c.Reader.(*pipe) - p.mu.Lock() - defer p.mu.Unlock() - p.rtimer.Stop() - p.rtimedout = false - if !t.IsZero() { - p.rtimer = time.AfterFunc(time.Until(t), func() { - p.mu.Lock() - defer p.mu.Unlock() - p.rtimedout = true - p.rwait.Broadcast() - }) - } - return nil -} - -func (c *conn) SetWriteDeadline(t time.Time) error { - p := c.Writer.(*pipe) - p.mu.Lock() - defer p.mu.Unlock() - p.wtimer.Stop() - p.wtimedout = false - if !t.IsZero() { - p.wtimer = time.AfterFunc(time.Until(t), func() { - p.mu.Lock() - defer p.mu.Unlock() - p.wtimedout = true - p.wwait.Broadcast() - }) - } - return nil -} - -func (*conn) LocalAddr() net.Addr { return addr{} } -func (*conn) RemoteAddr() net.Addr { return addr{} } - -type addr struct{} - -func (addr) Network() string { return "bufconn" } -func (addr) String() string { return "bufconn" } diff --git a/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS b/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS deleted file mode 100644 index 155648acb6df..000000000000 --- a/vendor/k8s.io/apimachinery/pkg/api/errors/OWNERS +++ /dev/null @@ -1,17 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - thockin - - lavalamp - - smarterclayton - - wojtek-t - - deads2k - - derekwaynecarr - - caesarxuchao - - mikedanese - - liggitt - - saad-ali - - janetkuo - - tallclair - - dims - - cjcullen diff --git a/vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS b/vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS deleted file mode 100644 index 1e1330fff279..000000000000 --- a/vendor/k8s.io/apimachinery/pkg/api/meta/OWNERS +++ /dev/null @@ -1,14 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - thockin - - smarterclayton - - wojtek-t - - deads2k - - derekwaynecarr - - caesarxuchao - - mikedanese - - liggitt - - janetkuo - - ncdc - - dims diff --git a/vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS b/vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS deleted file mode 100644 index d1c9f53074d5..000000000000 --- a/vendor/k8s.io/apimachinery/pkg/api/resource/OWNERS +++ /dev/null @@ -1,11 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - thockin - - lavalamp - - smarterclayton - - wojtek-t - - derekwaynecarr - - mikedanese - - saad-ali - - janetkuo diff --git a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS b/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS deleted file mode 100644 index e7e5c152d0b7..000000000000 --- a/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/OWNERS +++ /dev/null @@ -1,16 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - thockin - - smarterclayton - - wojtek-t - - deads2k - - caesarxuchao - - liggitt - - sttts - - luxas - - janetkuo - - justinsb - - ncdc - - soltysh - - dims diff --git a/vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS b/vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS deleted file mode 100644 index 349bc69d6582..000000000000 --- a/vendor/k8s.io/apimachinery/pkg/util/mergepatch/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - pwittrock -reviewers: - - apelisse diff --git a/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS b/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS deleted file mode 100644 index 4443bafd137b..000000000000 --- a/vendor/k8s.io/apimachinery/pkg/util/strategicpatch/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - pwittrock -reviewers: - - apelisse -emeritus_approvers: - - mengqiy diff --git a/vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS b/vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS deleted file mode 100644 index 349bc69d6582..000000000000 --- a/vendor/k8s.io/apimachinery/third_party/forked/golang/json/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - pwittrock -reviewers: - - apelisse diff --git a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS b/vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS deleted file mode 100644 index 4dfbb98aec85..000000000000 --- a/vendor/k8s.io/client-go/pkg/apis/clientauthentication/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -# approval on api packages bubbles to api-approvers -reviewers: - - sig-auth-authenticators-approvers - - sig-auth-authenticators-reviewers -labels: - - sig/auth diff --git a/vendor/k8s.io/client-go/rest/OWNERS b/vendor/k8s.io/client-go/rest/OWNERS deleted file mode 100644 index 7b23294c45e5..000000000000 --- a/vendor/k8s.io/client-go/rest/OWNERS +++ /dev/null @@ -1,14 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - thockin - - smarterclayton - - caesarxuchao - - wojtek-t - - deads2k - - liggitt - - sttts - - luxas - - dims - - cjcullen - - lojies diff --git a/vendor/k8s.io/client-go/tools/auth/OWNERS b/vendor/k8s.io/client-go/tools/auth/OWNERS deleted file mode 100644 index c4ea6463df4d..000000000000 --- a/vendor/k8s.io/client-go/tools/auth/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - sig-auth-authenticators-approvers -reviewers: - - sig-auth-authenticators-reviewers -labels: - - sig/auth diff --git a/vendor/k8s.io/client-go/tools/cache/OWNERS b/vendor/k8s.io/client-go/tools/cache/OWNERS deleted file mode 100644 index 726205b3dff3..000000000000 --- a/vendor/k8s.io/client-go/tools/cache/OWNERS +++ /dev/null @@ -1,28 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - thockin - - lavalamp - - smarterclayton - - wojtek-t - - deads2k - - caesarxuchao - - liggitt - - ncdc -reviewers: - - thockin - - lavalamp - - smarterclayton - - wojtek-t - - deads2k - - derekwaynecarr - - caesarxuchao - - mikedanese - - liggitt - - janetkuo - - justinsb - - soltysh - - jsafrane - - dims - - ingvagabund - - ncdc diff --git a/vendor/k8s.io/client-go/tools/leaderelection/OWNERS b/vendor/k8s.io/client-go/tools/leaderelection/OWNERS deleted file mode 100644 index 908bdacdfeec..000000000000 --- a/vendor/k8s.io/client-go/tools/leaderelection/OWNERS +++ /dev/null @@ -1,11 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - mikedanese -reviewers: - - wojtek-t - - deads2k - - mikedanese - - ingvagabund -emeritus_approvers: - - timothysc diff --git a/vendor/k8s.io/client-go/tools/metrics/OWNERS b/vendor/k8s.io/client-go/tools/metrics/OWNERS deleted file mode 100644 index 2c9488a5fb2c..000000000000 --- a/vendor/k8s.io/client-go/tools/metrics/OWNERS +++ /dev/null @@ -1,5 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - wojtek-t - - jayunit100 diff --git a/vendor/k8s.io/client-go/tools/record/OWNERS b/vendor/k8s.io/client-go/tools/record/OWNERS deleted file mode 100644 index 8105c4fe087c..000000000000 --- a/vendor/k8s.io/client-go/tools/record/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - sig-instrumentation-reviewers -approvers: - - sig-instrumentation-approvers diff --git a/vendor/k8s.io/client-go/transport/OWNERS b/vendor/k8s.io/client-go/transport/OWNERS deleted file mode 100644 index 34adee5ec539..000000000000 --- a/vendor/k8s.io/client-go/transport/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - smarterclayton - - wojtek-t - - deads2k - - liggitt - - caesarxuchao diff --git a/vendor/k8s.io/client-go/util/cert/OWNERS b/vendor/k8s.io/client-go/util/cert/OWNERS deleted file mode 100644 index 3c3b94c58c3f..000000000000 --- a/vendor/k8s.io/client-go/util/cert/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - sig-auth-certificates-approvers -reviewers: - - sig-auth-certificates-reviewers -labels: - - sig/auth diff --git a/vendor/k8s.io/client-go/util/keyutil/OWNERS b/vendor/k8s.io/client-go/util/keyutil/OWNERS deleted file mode 100644 index e6d229d5dbe1..000000000000 --- a/vendor/k8s.io/client-go/util/keyutil/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -approvers: - - sig-auth-certificates-approvers -reviewers: - - sig-auth-certificates-reviewers -labels: - - sig/auth diff --git a/vendor/k8s.io/client-go/util/retry/OWNERS b/vendor/k8s.io/client-go/util/retry/OWNERS deleted file mode 100644 index 75736b5aace8..000000000000 --- a/vendor/k8s.io/client-go/util/retry/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -reviewers: - - caesarxuchao diff --git a/vendor/k8s.io/code-generator/OWNERS b/vendor/k8s.io/code-generator/OWNERS deleted file mode 100644 index c59502195b90..000000000000 --- a/vendor/k8s.io/code-generator/OWNERS +++ /dev/null @@ -1,13 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - lavalamp - - wojtek-t - - sttts -reviewers: - - lavalamp - - wojtek-t - - sttts -labels: - - sig/api-machinery - - area/code-generation diff --git a/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS b/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS deleted file mode 100644 index 0170a84e8a95..000000000000 --- a/vendor/k8s.io/code-generator/cmd/client-gen/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - lavalamp - - wojtek-t - - caesarxuchao -reviewers: - - lavalamp - - wojtek-t - - caesarxuchao diff --git a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS b/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS deleted file mode 100644 index af7e2ec4c7d3..000000000000 --- a/vendor/k8s.io/code-generator/cmd/go-to-protobuf/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - smarterclayton -reviewers: - - smarterclayton diff --git a/vendor/k8s.io/klog/OWNERS b/vendor/k8s.io/klog/OWNERS deleted file mode 100644 index 380e514f2807..000000000000 --- a/vendor/k8s.io/klog/OWNERS +++ /dev/null @@ -1,19 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners -reviewers: - - jayunit100 - - hoegaarden - - andyxning - - neolit123 - - pohly - - yagonobre - - vincepri - - detiber -approvers: - - dims - - thockin - - justinsb - - tallclair - - piosz - - brancz - - DirectXMan12 - - lavalamp diff --git a/vendor/k8s.io/klog/v2/OWNERS b/vendor/k8s.io/klog/v2/OWNERS deleted file mode 100644 index a2fe8f351bf2..000000000000 --- a/vendor/k8s.io/klog/v2/OWNERS +++ /dev/null @@ -1,14 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners -reviewers: - - harshanarayana - - pohly -approvers: - - dims - - thockin - - serathius -emeritus_approvers: - - brancz - - justinsb - - lavalamp - - piosz - - tallclair diff --git a/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS b/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS deleted file mode 100644 index 235bc545b88b..000000000000 --- a/vendor/k8s.io/kube-openapi/pkg/generators/rules/OWNERS +++ /dev/null @@ -1,4 +0,0 @@ -reviewers: -- roycaihw -approvers: -- roycaihw diff --git a/vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS b/vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS deleted file mode 100644 index 9621a6a3a4ac..000000000000 --- a/vendor/k8s.io/kube-openapi/pkg/util/proto/OWNERS +++ /dev/null @@ -1,2 +0,0 @@ -approvers: -- apelisse diff --git a/vendor/k8s.io/utils/pointer/OWNERS b/vendor/k8s.io/utils/pointer/OWNERS deleted file mode 100644 index 0d6392752af2..000000000000 --- a/vendor/k8s.io/utils/pointer/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- apelisse -- stewart-yu -- thockin -reviewers: -- apelisse -- stewart-yu -- thockin diff --git a/vendor/knative.dev/hack/OWNERS b/vendor/knative.dev/hack/OWNERS deleted file mode 100644 index 4d20bf8cffef..000000000000 --- a/vendor/knative.dev/hack/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -approvers: - - technical-oversight-committee - - productivity-writers - - knative-release-leads - -reviewers: - - productivity-writers - - productivity-reviewers diff --git a/vendor/knative.dev/hack/OWNERS_ALIASES b/vendor/knative.dev/hack/OWNERS_ALIASES deleted file mode 100644 index 103ef9259116..000000000000 --- a/vendor/knative.dev/hack/OWNERS_ALIASES +++ /dev/null @@ -1,168 +0,0 @@ -# This file is auto-generated from peribolos. -# Do not modify this file, instead modify peribolos/knative.yaml - -aliases: - client-reviewers: - - itsmurugappan - client-wg-leads: - - dsimansk - - navidshaikh - - rhuss - client-writers: - - dsimansk - - maximilien - - navidshaikh - - rhuss - - vyasgun - conformance-task-force-leads: - - salaboy - conformance-writers: - - salaboy - docs-reviewers: - - nainaz - - pmbanugo - - snneji - docs-wg-leads: - - snneji - docs-writers: - - csantanapr - - psschwei - - snneji - eventing-reviewers: - - aslom - - creydr - eventing-triage: - - lberk - eventing-wg-leads: - - pierDipi - eventing-writers: - - aliok - - lberk - - lionelvillard - - matzew - - odacremolbap - - pierDipi - func-reviewers: - - jrangelramos - - nainaz - func-writers: - - jrangelramos - - lance - - lkingland - - matejvasek - - salaboy - - zroubalik - functions-wg-leads: - - lance - - salaboy - knative-admin: - - Vishal-Chdhry - - creydr - - csantanapr - - dprotaso - - dsimansk - - evankanderson - - knative-automation - - knative-prow-releaser-robot - - knative-prow-robot - - knative-prow-updater-robot - - knative-test-reporter-robot - - kvmware - - lance - - mchmarny - - nainaz - - pierDipi - - psschwei - - puerco - - salaboy - - skonto - - smoser-ibm - - upodroid - - zroubalik - knative-release-leads: - - Vishal-Chdhry - - creydr - - dsimansk - - pierDipi - - skonto - knative-robots: - - knative-automation - - knative-prow-releaser-robot - - knative-prow-robot - - knative-prow-updater-robot - - knative-test-reporter-robot - operations-reviewers: - - aliok - - houshengbo - - matzew - - maximilien - operations-wg-leads: - - houshengbo - operations-writers: - - aliok - - houshengbo - - matzew - - maximilien - productivity-leads: - - kvmware - - upodroid - productivity-reviewers: - - evankanderson - - mgencur - productivity-wg-leads: - - kvmware - - upodroid - productivity-writers: - - cardil - - kvmware - - psschwei - - upodroid - security-wg-leads: - - davidhadas - - evankanderson - security-writers: - - davidhadas - - evankanderson - serving-approvers: - - nak3 - - skonto - serving-reviewers: - - KauzClay - - jsanin-vmw - - kauana - - kvmware - - retocode - - skonto - - xtreme-vikram-yadav - serving-triage: - - KauzClay - - retocode - - skonto - serving-wg-leads: - - dprotaso - - psschwei - serving-writers: - - dprotaso - - nak3 - - psschwei - - skonto - steering-committee: - - csantanapr - - lance - - nainaz - - puerco - - salaboy - technical-oversight-committee: - - dprotaso - - dsimansk - - kvmware - - psschwei - - zroubalik - trademark-committee: - - evankanderson - - mchmarny - - smoser-ibm - ux-wg-leads: - - snneji - ux-writers: - - snneji diff --git a/vendor/knative.dev/pkg/apis/OWNERS b/vendor/knative.dev/pkg/apis/OWNERS deleted file mode 100644 index 13014203fc86..000000000000 --- a/vendor/knative.dev/pkg/apis/OWNERS +++ /dev/null @@ -1,15 +0,0 @@ -# The OWNERS file is used by prow to automatically merge approved PRs. - -approvers: -- technical-oversight-committee -- serving-wg-leads -- eventing-wg-leads - -reviewers: -- serving-writers -- eventing-writers -- eventing-reviewers -- serving-reviewers - -options: - no_parent_owners: true diff --git a/vendor/knative.dev/pkg/apis/duck/OWNERS b/vendor/knative.dev/pkg/apis/duck/OWNERS deleted file mode 100644 index af1eb05dac49..000000000000 --- a/vendor/knative.dev/pkg/apis/duck/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# The OWNERS file is used by prow to automatically merge approved PRs. - -approvers: -- eventing-wg-leads - -reviewers: -- eventing-reviewers -- eventing-writers diff --git a/vendor/knative.dev/pkg/controller/OWNERS b/vendor/knative.dev/pkg/controller/OWNERS deleted file mode 100644 index 64660c9e35d3..000000000000 --- a/vendor/knative.dev/pkg/controller/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# The OWNERS file is used by prow to automatically merge approved PRs. - -approvers: -- serving-writers - -reviewers: -- serving-reviewers diff --git a/vendor/knative.dev/pkg/hack/OWNERS b/vendor/knative.dev/pkg/hack/OWNERS deleted file mode 100644 index 65aa9e7b118e..000000000000 --- a/vendor/knative.dev/pkg/hack/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# The OWNERS file is used by prow to automatically merge approved PRs. - -approvers: -- productivity-writers - -reviewers: -- productivity-reviewers - -labels: -- area/test-and-release diff --git a/vendor/knative.dev/pkg/reconciler/OWNERS b/vendor/knative.dev/pkg/reconciler/OWNERS deleted file mode 100644 index 136197a30305..000000000000 --- a/vendor/knative.dev/pkg/reconciler/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# The OWNERS file is used by prow to automatically merge approved PRs. - -approvers: -- serving-writers - -reviewers: -- serving-writers diff --git a/vendor/knative.dev/pkg/resolver/OWNERS b/vendor/knative.dev/pkg/resolver/OWNERS deleted file mode 100644 index b5e9581f4ed0..000000000000 --- a/vendor/knative.dev/pkg/resolver/OWNERS +++ /dev/null @@ -1,8 +0,0 @@ -# The OWNERS file is used by prow to automatically merge approved PRs. - -approvers: -- eventing-writers - -reviewers: -- eventing-reviewers - diff --git a/vendor/knative.dev/pkg/test/OWNERS b/vendor/knative.dev/pkg/test/OWNERS deleted file mode 100644 index 65aa9e7b118e..000000000000 --- a/vendor/knative.dev/pkg/test/OWNERS +++ /dev/null @@ -1,10 +0,0 @@ -# The OWNERS file is used by prow to automatically merge approved PRs. - -approvers: -- productivity-writers - -reviewers: -- productivity-reviewers - -labels: -- area/test-and-release diff --git a/vendor/knative.dev/pkg/webhook/OWNERS b/vendor/knative.dev/pkg/webhook/OWNERS deleted file mode 100644 index 64660c9e35d3..000000000000 --- a/vendor/knative.dev/pkg/webhook/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -# The OWNERS file is used by prow to automatically merge approved PRs. - -approvers: -- serving-writers - -reviewers: -- serving-reviewers diff --git a/vendor/modules.txt b/vendor/modules.txt index 53d2947882eb..dcdf780ea14a 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -741,7 +741,6 @@ google.golang.org/grpc/serviceconfig google.golang.org/grpc/stats google.golang.org/grpc/status google.golang.org/grpc/tap -google.golang.org/grpc/test/bufconn # google.golang.org/protobuf v1.31.0 ## explicit; go 1.11 google.golang.org/protobuf/encoding/protojson diff --git a/vendor/sigs.k8s.io/json/OWNERS b/vendor/sigs.k8s.io/json/OWNERS deleted file mode 100644 index 0fadafbddbfd..000000000000 --- a/vendor/sigs.k8s.io/json/OWNERS +++ /dev/null @@ -1,6 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: - - deads2k - - lavalamp - - liggitt diff --git a/vendor/sigs.k8s.io/yaml/OWNERS b/vendor/sigs.k8s.io/yaml/OWNERS deleted file mode 100644 index 325b40b0763f..000000000000 --- a/vendor/sigs.k8s.io/yaml/OWNERS +++ /dev/null @@ -1,27 +0,0 @@ -# See the OWNERS docs at https://go.k8s.io/owners - -approvers: -- dims -- lavalamp -- smarterclayton -- deads2k -- sttts -- liggitt -- caesarxuchao -reviewers: -- dims -- thockin -- lavalamp -- smarterclayton -- wojtek-t -- deads2k -- derekwaynecarr -- caesarxuchao -- mikedanese -- liggitt -- gmarek -- sttts -- ncdc -- tallclair -labels: -- sig/api-machinery From 42450750fb872009b9df269e9b143b12ffebda1d Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Thu, 14 Sep 2023 21:08:06 +0900 Subject: [PATCH 13/18] Ignore readinessProbe when it's gRPC --- pkg/reconciler/revision/resources/deploy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/reconciler/revision/resources/deploy.go b/pkg/reconciler/revision/resources/deploy.go index a86e58f788a7..2f3a3ba459e7 100644 --- a/pkg/reconciler/revision/resources/deploy.go +++ b/pkg/reconciler/revision/resources/deploy.go @@ -267,8 +267,8 @@ func makeServingContainer(servingContainer corev1.Container, rev *v1.Revision) c servingContainer.Env = append(servingContainer.Env, buildUserPortEnv(userPortStr)) container := makeContainer(servingContainer, rev) if container.ReadinessProbe != nil { - if container.ReadinessProbe.HTTPGet != nil || container.ReadinessProbe.TCPSocket != nil { - // HTTP and TCP ReadinessProbes are executed by the queue-proxy directly against the + if container.ReadinessProbe.HTTPGet != nil || container.ReadinessProbe.TCPSocket != nil || container.ReadinessProbe.GRPC != nil { + // HTTP, TCP and gRPC ReadinessProbes are executed by the queue-proxy directly against the // user-container instead of via kubelet. container.ReadinessProbe = nil } From dd1b4f5a11b62e83edf531e7160ef3e20faddf4b Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Thu, 14 Sep 2023 21:16:18 +0900 Subject: [PATCH 14/18] Fix test to use empemeral port --- go.mod | 2 +- pkg/queue/readiness/probe_test.go | 46 ++++++++----------- .../revision/resources/deploy_test.go | 31 +++++++++++++ 3 files changed, 51 insertions(+), 28 deletions(-) diff --git a/go.mod b/go.mod index fd930f1f561b..6f9c5cc2c0f7 100644 --- a/go.mod +++ b/go.mod @@ -22,6 +22,7 @@ require ( go.uber.org/zap v1.25.0 golang.org/x/net v0.15.0 golang.org/x/sync v0.3.0 + golang.org/x/sys v0.12.0 golang.org/x/time v0.3.0 google.golang.org/api v0.140.0 google.golang.org/grpc v1.58.0 @@ -139,7 +140,6 @@ require ( golang.org/x/crypto v0.13.0 // indirect golang.org/x/mod v0.12.0 // indirect golang.org/x/oauth2 v0.12.0 // indirect - golang.org/x/sys v0.12.0 // indirect golang.org/x/term v0.12.0 // indirect golang.org/x/text v0.13.0 // indirect golang.org/x/tools v0.13.0 // indirect diff --git a/pkg/queue/readiness/probe_test.go b/pkg/queue/readiness/probe_test.go index 2a058ef881c6..de7f8f64b688 100644 --- a/pkg/queue/readiness/probe_test.go +++ b/pkg/queue/readiness/probe_test.go @@ -21,8 +21,6 @@ import ( "context" "errors" "fmt" - "google.golang.org/grpc" - "google.golang.org/grpc/health/grpc_health_v1" "net" "net/http" "net/http/httptest" @@ -33,6 +31,8 @@ import ( "go.uber.org/atomic" "golang.org/x/sync/errgroup" + "google.golang.org/grpc" + "google.golang.org/grpc/health/grpc_health_v1" "github.com/google/go-cmp/cmp" corev1 "k8s.io/api/core/v1" @@ -659,11 +659,23 @@ func TestKnTCPProbeSuccessThresholdIncludesFailure(t *testing.T) { } func TestGRPCSuccess(t *testing.T) { - port := 12345 - if err := newTestGRPCServer(t, port); err != nil { - t.Errorf("Failed to create test grpc server: %v", err) + t.Helper() + // use ephemeral port to prevent port conflict + lis, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("failed to listen: %v", err) } + s := grpc.NewServer() + grpc_health_v1.RegisterHealthServer(s, &grpcHealthServer{}) + + go func() { + if err := s.Serve(lis); err != nil { + t.Fatalf("Failed to run gRPC test server %v", err) + } + }() + + assignedPort := lis.Addr().(*net.TCPAddr).Port pb := NewProbe(&corev1.Probe{ PeriodSeconds: 1, TimeoutSeconds: 5, @@ -671,7 +683,7 @@ func TestGRPCSuccess(t *testing.T) { FailureThreshold: 1, ProbeHandler: corev1.ProbeHandler{ GRPC: &corev1.GRPCAction{ - Port: int32(port), + Port: int32(assignedPort), Service: nil, }, }, @@ -680,6 +692,7 @@ func TestGRPCSuccess(t *testing.T) { if !pb.ProbeContainer() { t.Error("Probe failed. Expected success.") } + t.Cleanup(s.Stop) } func newTestServer(t *testing.T, h http.HandlerFunc) *url.URL { @@ -696,27 +709,6 @@ func newTestServer(t *testing.T, h http.HandlerFunc) *url.URL { return u } -func newTestGRPCServer(t *testing.T, port int) error { - t.Helper() - grpcAddr := fmt.Sprintf("127.0.0.1:%d", port) - lis, err := net.Listen("tcp", grpcAddr) - if err != nil { - t.Fatalf("failed to listen: %v", err) - } - - s := grpc.NewServer() - grpc_health_v1.RegisterHealthServer(s, &grpcHealthServer{}) - - go func() { - if err := s.Serve(lis); err != nil { - t.Fatalf("Failed to run gRPC test server %v", err) - } - }() - t.Cleanup(s.Stop) - - return nil -} - type grpcHealthServer struct { grpc_health_v1.UnimplementedHealthServer } diff --git a/pkg/reconciler/revision/resources/deploy_test.go b/pkg/reconciler/revision/resources/deploy_test.go index eac04c49e412..a668d5efe1d3 100644 --- a/pkg/reconciler/revision/resources/deploy_test.go +++ b/pkg/reconciler/revision/resources/deploy_test.go @@ -346,6 +346,16 @@ func withHTTPReadinessProbe(port int) *corev1.Probe { }} } +func withGRPCReadinessProbe(port int) *corev1.Probe { + return &corev1.Probe{ + ProbeHandler: corev1.ProbeHandler{ + GRPC: &corev1.GRPCAction{ + Port: int32(port), + Service: nil, + }, + }} +} + func withExecReadinessProbe(command []string) *corev1.Probe { return &corev1.Probe{ ProbeHandler: corev1.ProbeHandler{ @@ -905,6 +915,27 @@ func TestMakePodSpec(t *testing.T) { withEnvVar("SERVING_READINESS_PROBE", `{"httpGet":{"path":"/","port":8080,"host":"127.0.0.1","scheme":"HTTP","httpHeaders":[{"name":"K-Kubelet-Probe","value":"queue"}]}}`), ), }), + }, { + name: "with grpc readiness probe", + rev: revision("bar", "foo", + withContainers([]corev1.Container{{ + Name: servingContainerName, + Image: "busybox", + ReadinessProbe: withGRPCReadinessProbe(v1.DefaultUserPort), + }}), + WithContainerStatuses([]v1.ContainerStatus{{ + ImageDigest: "busybox@sha256:deadbeef", + }}), + ), + want: podSpec( + []corev1.Container{ + servingContainer(func(container *corev1.Container) { + container.Image = "busybox@sha256:deadbeef" + }), + queueContainer( + withEnvVar("SERVING_READINESS_PROBE", `{"grpc":{"port":8080,"service":null}}`), + ), + }), }, { name: "with tcp readiness probe", rev: revision("bar", "foo", From 20be25d0458bdd99151331e878fbd329f1949979 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Tue, 19 Sep 2023 23:15:23 +0900 Subject: [PATCH 15/18] Resolve govet lint error --- pkg/queue/readiness/probe_test.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/pkg/queue/readiness/probe_test.go b/pkg/queue/readiness/probe_test.go index de7f8f64b688..52d76383a130 100644 --- a/pkg/queue/readiness/probe_test.go +++ b/pkg/queue/readiness/probe_test.go @@ -669,10 +669,9 @@ func TestGRPCSuccess(t *testing.T) { s := grpc.NewServer() grpc_health_v1.RegisterHealthServer(s, &grpcHealthServer{}) + errChan := make(chan error, 1) go func() { - if err := s.Serve(lis); err != nil { - t.Fatalf("Failed to run gRPC test server %v", err) - } + errChan <- s.Serve(lis) }() assignedPort := lis.Addr().(*net.TCPAddr).Port @@ -692,7 +691,14 @@ func TestGRPCSuccess(t *testing.T) { if !pb.ProbeContainer() { t.Error("Probe failed. Expected success.") } - t.Cleanup(s.Stop) + + // explicitly stop grpc server + s.Stop() + + if grpcServerErr := <-errChan; grpcServerErr != nil { + t.Fatalf("Failed to run gRPC test server %v", grpcServerErr) + } + close(errChan) } func newTestServer(t *testing.T, h http.HandlerFunc) *url.URL { From 65fffb3fa146f8e9dbcbf0ab48a0a3227d5b5bac Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Tue, 19 Sep 2023 23:18:18 +0900 Subject: [PATCH 16/18] Use errors.Is to compare --- pkg/queue/health/probe.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/queue/health/probe.go b/pkg/queue/health/probe.go index 43c2c255d59e..f1f48b6447c0 100644 --- a/pkg/queue/health/probe.go +++ b/pkg/queue/health/probe.go @@ -18,6 +18,7 @@ package health import ( "context" + "errors" "fmt" "io" "net" @@ -252,7 +253,7 @@ func GRPCProbe(config GRPCProbeConfigOptions) error { conn, err := grpc.DialContext(ctx, addr, opts...) if err != nil { - if err == context.DeadlineExceeded { + if errors.Is(err, context.DeadlineExceeded) { return fmt.Errorf("failed to connect service %q within %v: %w", addr, config.Timeout, err) } else { return fmt.Errorf("failed to connect service at %q: %w", addr, err) From c3d93618dc433445c6c725800fa85e8ab279c91d Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Tue, 19 Sep 2023 23:20:38 +0900 Subject: [PATCH 17/18] Also use ephemeral port for handler test --- pkg/queue/health/probe_test.go | 49 +++++++++++++++------------------- 1 file changed, 22 insertions(+), 27 deletions(-) diff --git a/pkg/queue/health/probe_test.go b/pkg/queue/health/probe_test.go index 328be13eb12f..d4e5eb298e63 100644 --- a/pkg/queue/health/probe_test.go +++ b/pkg/queue/health/probe_test.go @@ -18,7 +18,6 @@ package health import ( "context" - "fmt" "net" "net/http" "net/http/httptest" @@ -272,13 +271,22 @@ func TestHTTPProbeResponseErrorFailure(t *testing.T) { } func TestGRPCProbeSuccessWithDefaultServiceName(t *testing.T) { - port := 12345 - - if err := newTestGRPCServer(t, port); err != nil { - t.Errorf("Failed to create test grpc server: %v", err) + // use ephemeral port to prevent port conflict + lis, err := net.Listen("tcp", "127.0.0.1:0") + if err != nil { + t.Fatalf("failed to listen: %v", err) } - gRPCAction := newGRPCAction(t, port, "") + s := grpc.NewServer() + grpc_health_v1.RegisterHealthServer(s, &grpcHealthServer{}) + + errChan := make(chan error, 1) + go func() { + errChan <- s.Serve(lis) + }() + + assignedPort := lis.Addr().(*net.TCPAddr).Port + gRPCAction := newGRPCAction(t, assignedPort, "") config := GRPCProbeConfigOptions{ Timeout: time.Second, GRPCAction: gRPCAction, @@ -287,6 +295,14 @@ func TestGRPCProbeSuccessWithDefaultServiceName(t *testing.T) { if err := GRPCProbe(config); err != nil { t.Error("Expected probe to succeed but it failed with", err) } + + // explicitly stop grpc server + s.Stop() + + if grpcServerErr := <-errChan; grpcServerErr != nil { + t.Fatalf("Failed to run gRPC test server %v", grpcServerErr) + } + close(errChan) } func newH2cTestServer(t *testing.T, handler http.HandlerFunc) *httptest.Server { @@ -310,27 +326,6 @@ func newTestServer(t *testing.T, handler http.HandlerFunc) *httptest.Server { return server } -func newTestGRPCServer(t *testing.T, port int) error { - t.Helper() - grpcAddr := fmt.Sprintf("127.0.0.1:%d", port) - lis, err := net.Listen("tcp", grpcAddr) - if err != nil { - t.Fatalf("failed to listen: %v", err) - } - - s := grpc.NewServer() - grpc_health_v1.RegisterHealthServer(s, &grpcHealthServer{}) - - go func() { - if err := s.Serve(lis); err != nil { - t.Fatalf("Failed to run gRPC test server %v", err) - } - }() - t.Cleanup(s.Stop) - - return nil -} - func newHTTPGetAction(t *testing.T, serverURL string) *corev1.HTTPGetAction { t.Helper() From d3e8464f35e2b02a04871bb03861286d473f70a3 Mon Sep 17 00:00:00 2001 From: Hong Seongpyo Date: Wed, 20 Sep 2023 10:27:41 +0900 Subject: [PATCH 18/18] drop unneccesary else block --- pkg/queue/health/probe.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/queue/health/probe.go b/pkg/queue/health/probe.go index f1f48b6447c0..2aa0d6e27e4d 100644 --- a/pkg/queue/health/probe.go +++ b/pkg/queue/health/probe.go @@ -255,9 +255,8 @@ func GRPCProbe(config GRPCProbeConfigOptions) error { if err != nil { if errors.Is(err, context.DeadlineExceeded) { return fmt.Errorf("failed to connect service %q within %v: %w", addr, config.Timeout, err) - } else { - return fmt.Errorf("failed to connect service at %q: %w", addr, err) } + return fmt.Errorf("failed to connect service at %q: %w", addr, err) } defer func() {