From f4da02580d90711e31307e5d4c9089f85979bd6c Mon Sep 17 00:00:00 2001 From: Jiaxin Shan Date: Mon, 11 Jul 2022 10:53:32 -0700 Subject: [PATCH] Enable DefaultHTTPErrorHandler and Upgrade grpc-gateway to v2 (#369) * Upgrade grpc-gateway to v2 * Customize error and enable DefaultHTTPErrorHandler 1. Enable `runtime.DefaultHTTPErrorHandler` to convert gRPC status code to HTTP code. 2. Since we use custom error struct, we need to implement `GRPCStatus` to make sure grpc-go can recognize the error code in our struct, Otherwise, it will always return codes.Unknown(2), that's the reason we always see code 2 and HTTP 500 in the past. --- apiserver/cmd/main.go | 15 ++-- apiserver/pkg/manager/resource_manager.go | 10 ++- apiserver/pkg/util/error.go | 8 +++ proto/Dockerfile | 2 +- proto/Makefile | 2 +- proto/go.mod | 3 +- proto/go.sum | 1 + proto/go_client/cluster.pb.gw.go | 50 +++++--------- proto/go_client/config.pb.gw.go | 84 ++++++++--------------- 9 files changed, 80 insertions(+), 95 deletions(-) diff --git a/apiserver/cmd/main.go b/apiserver/cmd/main.go index 5474ffee6a..168882b458 100644 --- a/apiserver/cmd/main.go +++ b/apiserver/cmd/main.go @@ -3,7 +3,6 @@ package main import ( "context" "flag" - "math" "net" "net/http" @@ -11,10 +10,10 @@ import ( "strings" assetfs "github.com/elazarl/go-bindata-assetfs" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" "google.golang.org/grpc" "google.golang.org/grpc/reflection" + "google.golang.org/protobuf/encoding/protojson" "k8s.io/klog/v2" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" @@ -82,7 +81,15 @@ func startHttpProxy() { defer cancel() // Create gRPC HTTP MUX and register services. - runtimeMux := runtime.NewServeMux(runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{OrigName: true, EmitDefaults: true})) + runtimeMux := runtime.NewServeMux( + runtime.WithMarshalerOption(runtime.MIMEWildcard, &runtime.JSONPb{ + MarshalOptions: protojson.MarshalOptions{ + UseProtoNames: true, + UseEnumNumbers: true, + }, + }), + runtime.WithErrorHandler(runtime.DefaultHTTPErrorHandler), + ) registerHttpHandlerFromEndpoint(api.RegisterClusterServiceHandlerFromEndpoint, "ClusterService", ctx, runtimeMux) registerHttpHandlerFromEndpoint(api.RegisterComputeTemplateServiceHandlerFromEndpoint, "ComputeTemplateService", ctx, runtimeMux) diff --git a/apiserver/pkg/manager/resource_manager.go b/apiserver/pkg/manager/resource_manager.go index 50ada27a46..30026bdfa6 100644 --- a/apiserver/pkg/manager/resource_manager.go +++ b/apiserver/pkg/manager/resource_manager.go @@ -5,12 +5,12 @@ import ( "fmt" "github.com/ray-project/kuberay/apiserver/pkg/model" - "github.com/ray-project/kuberay/apiserver/pkg/util" api "github.com/ray-project/kuberay/proto/go_client" "github.com/ray-project/kuberay/ray-operator/apis/ray/v1alpha1" rayiov1alpha1 "github.com/ray-project/kuberay/ray-operator/pkg/client/clientset/versioned/typed/raycluster/v1alpha1" v1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" clientv1 "k8s.io/client-go/kubernetes/typed/core/v1" @@ -264,6 +264,10 @@ func (r *ResourceManager) DeleteComputeTemplate(ctx context.Context, name string func getClusterByName(ctx context.Context, client rayiov1alpha1.RayClusterInterface, name string) (*v1alpha1.RayCluster, error) { cluster, err := client.Get(ctx, name, metav1.GetOptions{}) if err != nil { + if errors.IsNotFound(err) { + return nil, util.NewNotFoundError(err, "Cluster %s not found", name) + } + return nil, util.Wrap(err, "Get Cluster failed") } if managedBy, ok := cluster.Labels[util.KubernetesManagedByLabelKey]; !ok || managedBy != util.ComponentName { @@ -277,6 +281,10 @@ func getClusterByName(ctx context.Context, client rayiov1alpha1.RayClusterInterf func getComputeTemplateByName(ctx context.Context, client clientv1.ConfigMapInterface, name string) (*v1.ConfigMap, error) { runtime, err := client.Get(ctx, name, metav1.GetOptions{}) if err != nil { + if errors.IsNotFound(err) { + return nil, util.NewNotFoundError(err, "Cluster %s not found", name) + } + return nil, util.Wrap(err, "Get compute template failed") } diff --git a/apiserver/pkg/util/error.go b/apiserver/pkg/util/error.go index 75a3672e91..184eda0f7c 100644 --- a/apiserver/pkg/util/error.go +++ b/apiserver/pkg/util/error.go @@ -7,6 +7,7 @@ import ( "github.com/golang/glog" "github.com/pkg/errors" "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" k8errors "k8s.io/apimachinery/pkg/api/errors" k8metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -215,6 +216,13 @@ func (e *UserError) String() string { e.internalError) } +// GRPCStatus implements `GRPCStatus` to make sure `FromError` in grpc-go can honor the code. +// Otherwise, it will always return codes.Unknown(2). +// https://github.com/grpc/grpc-go/blob/2c0949c22d46095edc579d9e66edcd025192b98c/status/status.go#L91-L92 +func (e *UserError) GRPCStatus() *status.Status { + return status.New(e.externalStatusCode, e.externalMessage) +} + func (e *UserError) wrapf(format string, args ...interface{}) *UserError { return newUserError(errors.Wrapf(e.internalError, format, args...), e.externalMessage, e.externalStatusCode) diff --git a/proto/Dockerfile b/proto/Dockerfile index 7bc872b284..bda584758d 100644 --- a/proto/Dockerfile +++ b/proto/Dockerfile @@ -1,5 +1,5 @@ # Generate client code (go & json) from API protocol buffers -FROM golang:1.16.6 as generator +FROM golang:1.17.8 as generator ENV PROTOC_VERSION 3.17.3 ENV GOLANG_PROTOBUF_VERSION v1.5.2 diff --git a/proto/Makefile b/proto/Makefile index 8aed3d96fc..8a9c684e7f 100644 --- a/proto/Makefile +++ b/proto/Makefile @@ -2,7 +2,7 @@ IMAGE_NAME=kuberay/proto-generator IMAGE_TAG=$(shell git rev-parse HEAD) -PREBUILT_REMOTE_IMAGE=kuberay/proto-generator:550d4af484e4e1d2f92117357cc49ffcdc2e41ce +PREBUILT_REMOTE_IMAGE=kuberay/proto-generator:8210e17c28b3b373449f99561f10534e13d35969 OUTPUT_MODE=import TMP_OUTPUT=/tmp diff --git a/proto/go.mod b/proto/go.mod index 8315a2f031..cf7d73fa54 100644 --- a/proto/go.mod +++ b/proto/go.mod @@ -3,8 +3,6 @@ module github.com/ray-project/kuberay/proto go 1.17 require ( - github.com/golang/protobuf v1.5.2 - github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-gateway/v2 v2.6.0 google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af google.golang.org/grpc v1.40.0 @@ -12,6 +10,7 @@ require ( ) require ( + github.com/golang/protobuf v1.5.2 // indirect golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4 // indirect golang.org/x/sys v0.0.0-20210510120138-977fb7262007 // indirect golang.org/x/text v0.3.5 // indirect diff --git a/proto/go.sum b/proto/go.sum index e8a37c4f99..afa275f668 100644 --- a/proto/go.sum +++ b/proto/go.sum @@ -56,6 +56,7 @@ github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9 github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ= github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= diff --git a/proto/go_client/cluster.pb.gw.go b/proto/go_client/cluster.pb.gw.go index 2a1a119d7a..25ec506432 100644 --- a/proto/go_client/cluster.pb.gw.go +++ b/proto/go_client/cluster.pb.gw.go @@ -13,15 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -30,7 +29,6 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage var _ = metadata.Join func request_ClusterService_CreateCluster_0(ctx context.Context, marshaler runtime.Marshaler, client ClusterServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -58,7 +56,6 @@ func request_ClusterService_CreateCluster_0(ctx context.Context, marshaler runti } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -93,7 +90,6 @@ func local_request_ClusterService_CreateCluster_0(ctx context.Context, marshaler } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -120,7 +116,6 @@ func request_ClusterService_GetCluster_0(ctx context.Context, marshaler runtime. } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -131,7 +126,6 @@ func request_ClusterService_GetCluster_0(ctx context.Context, marshaler runtime. } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -158,7 +152,6 @@ func local_request_ClusterService_GetCluster_0(ctx context.Context, marshaler ru } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -169,7 +162,6 @@ func local_request_ClusterService_GetCluster_0(ctx context.Context, marshaler ru } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -196,7 +188,6 @@ func request_ClusterService_ListCluster_0(ctx context.Context, marshaler runtime } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -223,7 +214,6 @@ func local_request_ClusterService_ListCluster_0(ctx context.Context, marshaler r } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -268,7 +258,6 @@ func request_ClusterService_DeleteCluster_0(ctx context.Context, marshaler runti } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -279,7 +268,6 @@ func request_ClusterService_DeleteCluster_0(ctx context.Context, marshaler runti } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -306,7 +294,6 @@ func local_request_ClusterService_DeleteCluster_0(ctx context.Context, marshaler } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -317,7 +304,6 @@ func local_request_ClusterService_DeleteCluster_0(ctx context.Context, marshaler } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -339,7 +325,7 @@ func RegisterClusterServiceHandlerServer(ctx context.Context, mux *runtime.Serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ClusterService/CreateCluster", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/clusters")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -362,7 +348,7 @@ func RegisterClusterServiceHandlerServer(ctx context.Context, mux *runtime.Serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ClusterService/GetCluster", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/clusters/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -385,7 +371,7 @@ func RegisterClusterServiceHandlerServer(ctx context.Context, mux *runtime.Serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ClusterService/ListCluster", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/clusters")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -408,7 +394,7 @@ func RegisterClusterServiceHandlerServer(ctx context.Context, mux *runtime.Serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ClusterService/ListAllClusters", runtime.WithHTTPPathPattern("/apis/v1alpha2/clusters")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -431,7 +417,7 @@ func RegisterClusterServiceHandlerServer(ctx context.Context, mux *runtime.Serve var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ClusterService/DeleteCluster", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/clusters/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -493,7 +479,7 @@ func RegisterClusterServiceHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ClusterService/CreateCluster", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/clusters")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -513,7 +499,7 @@ func RegisterClusterServiceHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ClusterService/GetCluster", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/clusters/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -533,7 +519,7 @@ func RegisterClusterServiceHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ClusterService/ListCluster", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/clusters")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -553,7 +539,7 @@ func RegisterClusterServiceHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ClusterService/ListAllClusters", runtime.WithHTTPPathPattern("/apis/v1alpha2/clusters")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -573,7 +559,7 @@ func RegisterClusterServiceHandlerClient(ctx context.Context, mux *runtime.Serve ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ClusterService/DeleteCluster", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/clusters/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -593,15 +579,15 @@ func RegisterClusterServiceHandlerClient(ctx context.Context, mux *runtime.Serve } var ( - pattern_ClusterService_CreateCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1alpha2", "namespaces", "namespace", "clusters"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ClusterService_CreateCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1alpha2", "namespaces", "namespace", "clusters"}, "")) - pattern_ClusterService_GetCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "clusters", "name"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ClusterService_GetCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "clusters", "name"}, "")) - pattern_ClusterService_ListCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1alpha2", "namespaces", "namespace", "clusters"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ClusterService_ListCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1alpha2", "namespaces", "namespace", "clusters"}, "")) - pattern_ClusterService_ListAllClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1alpha2", "clusters"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ClusterService_ListAllClusters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1alpha2", "clusters"}, "")) - pattern_ClusterService_DeleteCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "clusters", "name"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ClusterService_DeleteCluster_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "clusters", "name"}, "")) ) var ( diff --git a/proto/go_client/config.pb.gw.go b/proto/go_client/config.pb.gw.go index 362d8ee951..5735e2a52e 100644 --- a/proto/go_client/config.pb.gw.go +++ b/proto/go_client/config.pb.gw.go @@ -13,15 +13,14 @@ import ( "io" "net/http" - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" + "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" + "github.com/grpc-ecosystem/grpc-gateway/v2/utilities" "google.golang.org/grpc" "google.golang.org/grpc/codes" "google.golang.org/grpc/grpclog" "google.golang.org/grpc/metadata" "google.golang.org/grpc/status" + "google.golang.org/protobuf/proto" ) // Suppress "imported and not used" errors @@ -30,7 +29,6 @@ var _ io.Reader var _ status.Status var _ = runtime.String var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage var _ = metadata.Join func request_ComputeTemplateService_CreateComputeTemplate_0(ctx context.Context, marshaler runtime.Marshaler, client ComputeTemplateServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -58,7 +56,6 @@ func request_ComputeTemplateService_CreateComputeTemplate_0(ctx context.Context, } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -93,7 +90,6 @@ func local_request_ComputeTemplateService_CreateComputeTemplate_0(ctx context.Co } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -120,7 +116,6 @@ func request_ComputeTemplateService_GetComputeTemplate_0(ctx context.Context, ma } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -131,7 +126,6 @@ func request_ComputeTemplateService_GetComputeTemplate_0(ctx context.Context, ma } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -158,7 +152,6 @@ func local_request_ComputeTemplateService_GetComputeTemplate_0(ctx context.Conte } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -169,7 +162,6 @@ func local_request_ComputeTemplateService_GetComputeTemplate_0(ctx context.Conte } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -196,7 +188,6 @@ func request_ComputeTemplateService_ListComputeTemplates_0(ctx context.Context, } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -223,7 +214,6 @@ func local_request_ComputeTemplateService_ListComputeTemplates_0(ctx context.Con } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -268,7 +258,6 @@ func request_ComputeTemplateService_DeleteComputeTemplate_0(ctx context.Context, } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -279,7 +268,6 @@ func request_ComputeTemplateService_DeleteComputeTemplate_0(ctx context.Context, } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -306,7 +294,6 @@ func local_request_ComputeTemplateService_DeleteComputeTemplate_0(ctx context.Co } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -317,7 +304,6 @@ func local_request_ComputeTemplateService_DeleteComputeTemplate_0(ctx context.Co } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -396,7 +382,6 @@ func request_ImageTemplateService_GetImageTemplate_0(ctx context.Context, marsha } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -407,7 +392,6 @@ func request_ImageTemplateService_GetImageTemplate_0(ctx context.Context, marsha } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -434,7 +418,6 @@ func local_request_ImageTemplateService_GetImageTemplate_0(ctx context.Context, } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -445,7 +428,6 @@ func local_request_ImageTemplateService_GetImageTemplate_0(ctx context.Context, } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -472,7 +454,6 @@ func request_ImageTemplateService_ListImageTemplates_0(ctx context.Context, mars } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -499,7 +480,6 @@ func local_request_ImageTemplateService_ListImageTemplates_0(ctx context.Context } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -526,7 +506,6 @@ func request_ImageTemplateService_DeleteImageTemplate_0(ctx context.Context, mar } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -537,7 +516,6 @@ func request_ImageTemplateService_DeleteImageTemplate_0(ctx context.Context, mar } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -564,7 +542,6 @@ func local_request_ImageTemplateService_DeleteImageTemplate_0(ctx context.Contex } protoReq.Namespace, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "namespace", err) } @@ -575,7 +552,6 @@ func local_request_ImageTemplateService_DeleteImageTemplate_0(ctx context.Contex } protoReq.Name, err = runtime.String(val) - if err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) } @@ -597,7 +573,7 @@ func RegisterComputeTemplateServiceHandlerServer(ctx context.Context, mux *runti var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ComputeTemplateService/CreateComputeTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/compute_templates")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -620,7 +596,7 @@ func RegisterComputeTemplateServiceHandlerServer(ctx context.Context, mux *runti var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ComputeTemplateService/GetComputeTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/compute_templates/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -643,7 +619,7 @@ func RegisterComputeTemplateServiceHandlerServer(ctx context.Context, mux *runti var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ComputeTemplateService/ListComputeTemplates", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/compute_templates")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -666,7 +642,7 @@ func RegisterComputeTemplateServiceHandlerServer(ctx context.Context, mux *runti var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ComputeTemplateService/ListAllComputeTemplates", runtime.WithHTTPPathPattern("/apis/v1alpha2/compute_templates")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -689,7 +665,7 @@ func RegisterComputeTemplateServiceHandlerServer(ctx context.Context, mux *runti var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ComputeTemplateService/DeleteComputeTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/compute_templates/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -721,7 +697,7 @@ func RegisterImageTemplateServiceHandlerServer(ctx context.Context, mux *runtime var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ImageTemplateService/CreateImageTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/image_templates")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -744,7 +720,7 @@ func RegisterImageTemplateServiceHandlerServer(ctx context.Context, mux *runtime var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ImageTemplateService/GetImageTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/image_templates/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -767,7 +743,7 @@ func RegisterImageTemplateServiceHandlerServer(ctx context.Context, mux *runtime var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ImageTemplateService/ListImageTemplates", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/image_templates")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -790,7 +766,7 @@ func RegisterImageTemplateServiceHandlerServer(ctx context.Context, mux *runtime var stream runtime.ServerTransportStream ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/proto.ImageTemplateService/DeleteImageTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/image_templates/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -852,7 +828,7 @@ func RegisterComputeTemplateServiceHandlerClient(ctx context.Context, mux *runti ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ComputeTemplateService/CreateComputeTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/compute_templates")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -872,7 +848,7 @@ func RegisterComputeTemplateServiceHandlerClient(ctx context.Context, mux *runti ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ComputeTemplateService/GetComputeTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/compute_templates/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -892,7 +868,7 @@ func RegisterComputeTemplateServiceHandlerClient(ctx context.Context, mux *runti ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ComputeTemplateService/ListComputeTemplates", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/compute_templates")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -912,7 +888,7 @@ func RegisterComputeTemplateServiceHandlerClient(ctx context.Context, mux *runti ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ComputeTemplateService/ListAllComputeTemplates", runtime.WithHTTPPathPattern("/apis/v1alpha2/compute_templates")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -932,7 +908,7 @@ func RegisterComputeTemplateServiceHandlerClient(ctx context.Context, mux *runti ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ComputeTemplateService/DeleteComputeTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/compute_templates/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -952,15 +928,15 @@ func RegisterComputeTemplateServiceHandlerClient(ctx context.Context, mux *runti } var ( - pattern_ComputeTemplateService_CreateComputeTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1alpha2", "namespaces", "namespace", "compute_templates"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ComputeTemplateService_CreateComputeTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1alpha2", "namespaces", "namespace", "compute_templates"}, "")) - pattern_ComputeTemplateService_GetComputeTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "compute_templates", "name"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ComputeTemplateService_GetComputeTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "compute_templates", "name"}, "")) - pattern_ComputeTemplateService_ListComputeTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1alpha2", "namespaces", "namespace", "compute_templates"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ComputeTemplateService_ListComputeTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1alpha2", "namespaces", "namespace", "compute_templates"}, "")) - pattern_ComputeTemplateService_ListAllComputeTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1alpha2", "compute_templates"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ComputeTemplateService_ListAllComputeTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1alpha2", "compute_templates"}, "")) - pattern_ComputeTemplateService_DeleteComputeTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "compute_templates", "name"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ComputeTemplateService_DeleteComputeTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "compute_templates", "name"}, "")) ) var ( @@ -1017,7 +993,7 @@ func RegisterImageTemplateServiceHandlerClient(ctx context.Context, mux *runtime ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ImageTemplateService/CreateImageTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/image_templates")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1037,7 +1013,7 @@ func RegisterImageTemplateServiceHandlerClient(ctx context.Context, mux *runtime ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ImageTemplateService/GetImageTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/image_templates/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1057,7 +1033,7 @@ func RegisterImageTemplateServiceHandlerClient(ctx context.Context, mux *runtime ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ImageTemplateService/ListImageTemplates", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/image_templates")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1077,7 +1053,7 @@ func RegisterImageTemplateServiceHandlerClient(ctx context.Context, mux *runtime ctx, cancel := context.WithCancel(req.Context()) defer cancel() inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req, "/proto.ImageTemplateService/DeleteImageTemplate", runtime.WithHTTPPathPattern("/apis/v1alpha2/namespaces/{namespace}/image_templates/{name}")) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return @@ -1097,13 +1073,13 @@ func RegisterImageTemplateServiceHandlerClient(ctx context.Context, mux *runtime } var ( - pattern_ImageTemplateService_CreateImageTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1alpha2", "image_templates"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ImageTemplateService_CreateImageTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"apis", "v1alpha2", "image_templates"}, "")) - pattern_ImageTemplateService_GetImageTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "image_templates", "name"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ImageTemplateService_GetImageTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "image_templates", "name"}, "")) - pattern_ImageTemplateService_ListImageTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1alpha2", "namespaces", "namespace", "image_templates"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ImageTemplateService_ListImageTemplates_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"apis", "v1alpha2", "namespaces", "namespace", "image_templates"}, "")) - pattern_ImageTemplateService_DeleteImageTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "image_templates", "name"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_ImageTemplateService_DeleteImageTemplate_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"apis", "v1alpha2", "namespaces", "namespace", "image_templates", "name"}, "")) ) var (