From daac44e61dce49ab07c7fd2ad1778ad0bebdfac6 Mon Sep 17 00:00:00 2001 From: Wanxing Wang Date: Mon, 25 Jul 2022 14:31:13 +0800 Subject: [PATCH 1/2] fix proto comments --- apiserver/pkg/manager/resource_manager.go | 2 +- docs/design/protobuf-grpc-service.md | 2 +- proto/config.proto | 2 +- proto/go_client/config_grpc.pb.go | 4 ++-- proto/swagger/config.swagger.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apiserver/pkg/manager/resource_manager.go b/apiserver/pkg/manager/resource_manager.go index 8ee0c6436e7..a221382903c 100644 --- a/apiserver/pkg/manager/resource_manager.go +++ b/apiserver/pkg/manager/resource_manager.go @@ -282,7 +282,7 @@ func getComputeTemplateByName(ctx context.Context, client clientv1.ConfigMapInte 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.NewNotFoundError(err, "Compute template %s not found", name) } return nil, util.Wrap(err, "Get compute template failed") diff --git a/docs/design/protobuf-grpc-service.md b/docs/design/protobuf-grpc-service.md index 193a37516ab..3d1e8ca1080 100644 --- a/docs/design/protobuf-grpc-service.md +++ b/docs/design/protobuf-grpc-service.md @@ -215,7 +215,7 @@ service ComputeTemplateService { }; } - // Finds all compute templates in a given namespace. Supports pagination, and sorting on certain fields. + // Finds all compute templates in all namespaces. Supports pagination, and sorting on certain fields. rpc ListAllComputeTemplates(ListAllComputeTemplatesRequest) returns (ListAllComputeTemplatesResponse) { option (google.api.http) = { get: "/apis/v1alpha2/compute_templates" diff --git a/proto/config.proto b/proto/config.proto index 5c1e1723c8f..6edeb2c74c9 100644 --- a/proto/config.proto +++ b/proto/config.proto @@ -45,7 +45,7 @@ service ComputeTemplateService { }; } - // Finds all compute templates in a given namespace. Supports pagination, and sorting on certain fields. + // Finds all compute templates in all namespaces. Supports pagination, and sorting on certain fields. rpc ListAllComputeTemplates(ListAllComputeTemplatesRequest) returns (ListAllComputeTemplatesResponse) { option (google.api.http) = { get: "/apis/v1alpha2/compute_templates" diff --git a/proto/go_client/config_grpc.pb.go b/proto/go_client/config_grpc.pb.go index 3beea0d68da..36e12123beb 100644 --- a/proto/go_client/config_grpc.pb.go +++ b/proto/go_client/config_grpc.pb.go @@ -25,7 +25,7 @@ type ComputeTemplateServiceClient interface { GetComputeTemplate(ctx context.Context, in *GetComputeTemplateRequest, opts ...grpc.CallOption) (*ComputeTemplate, error) // Finds all compute templates in a given namespace. Supports pagination, and sorting on certain fields. ListComputeTemplates(ctx context.Context, in *ListComputeTemplatesRequest, opts ...grpc.CallOption) (*ListComputeTemplatesResponse, error) - // Finds all compute templates in a given namespace. Supports pagination, and sorting on certain fields. + // Finds all compute templates in all namespaces. Supports pagination, and sorting on certain fields. ListAllComputeTemplates(ctx context.Context, in *ListAllComputeTemplatesRequest, opts ...grpc.CallOption) (*ListAllComputeTemplatesResponse, error) // Deletes a compute template by its name and namespace DeleteComputeTemplate(ctx context.Context, in *DeleteComputeTemplateRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) @@ -94,7 +94,7 @@ type ComputeTemplateServiceServer interface { GetComputeTemplate(context.Context, *GetComputeTemplateRequest) (*ComputeTemplate, error) // Finds all compute templates in a given namespace. Supports pagination, and sorting on certain fields. ListComputeTemplates(context.Context, *ListComputeTemplatesRequest) (*ListComputeTemplatesResponse, error) - // Finds all compute templates in a given namespace. Supports pagination, and sorting on certain fields. + // Finds all compute templates in all namespaces. Supports pagination, and sorting on certain fields. ListAllComputeTemplates(context.Context, *ListAllComputeTemplatesRequest) (*ListAllComputeTemplatesResponse, error) // Deletes a compute template by its name and namespace DeleteComputeTemplate(context.Context, *DeleteComputeTemplateRequest) (*emptypb.Empty, error) diff --git a/proto/swagger/config.swagger.json b/proto/swagger/config.swagger.json index c331a2fd97f..ce2ce8d8e5a 100644 --- a/proto/swagger/config.swagger.json +++ b/proto/swagger/config.swagger.json @@ -24,7 +24,7 @@ "paths": { "/apis/v1alpha2/compute_templates": { "get": { - "summary": "Finds all compute templates in a given namespace. Supports pagination, and sorting on certain fields.", + "summary": "Finds all compute templates in all namespaces. Supports pagination, and sorting on certain fields.", "operationId": "ComputeTemplateService_ListAllComputeTemplates", "responses": { "200": { From e3cd1eb8bd401acc9e22361492c9431c72c451ca Mon Sep 17 00:00:00 2001 From: Wanxing Wang Date: Mon, 25 Jul 2022 15:00:01 +0800 Subject: [PATCH 2/2] fix --- apiserver/pkg/manager/resource_manager.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apiserver/pkg/manager/resource_manager.go b/apiserver/pkg/manager/resource_manager.go index a221382903c..8d15dcafbde 100644 --- a/apiserver/pkg/manager/resource_manager.go +++ b/apiserver/pkg/manager/resource_manager.go @@ -211,7 +211,7 @@ func (r *ResourceManager) ListComputeTemplates(ctx context.Context, namespace st client := r.getKubernetesConfigMapClient(namespace) configMapList, err := client.List(ctx, metav1.ListOptions{LabelSelector: "ray.io/config-type=compute-template"}) if err != nil { - return nil, util.Wrap(err, "List compute runtimes failed") + return nil, util.Wrap(err, "List compute templates failed") } var result []*v1.ConfigMap