Skip to content

Commit 185ba8a

Browse files
Google APIscopybara-github
authored andcommitted
fix!: Updates pre-release Cloud Run v2 Preview client libraries to work with the latest API revision
PiperOrigin-RevId: 447174265
1 parent 02b3022 commit 185ba8a

7 files changed

Lines changed: 75 additions & 90 deletions

File tree

google/cloud/run/v2/BUILD.bazel

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ proto_library(
3535
"//google/api:field_behavior_proto",
3636
"//google/api:launch_stage_proto",
3737
"//google/api:resource_proto",
38+
"//google/api:routing_proto",
3839
"//google/iam/v1:iam_policy_proto",
3940
"//google/iam/v1:policy_proto",
4041
"//google/longrunning:operations_proto",
4142
"@com_google_protobuf//:duration_proto",
42-
"@com_google_protobuf//:field_mask_proto",
4343
"@com_google_protobuf//:timestamp_proto",
4444
],
4545
)
@@ -131,6 +131,7 @@ go_proto_library(
131131
deps = [
132132
"//google/api:annotations_go_proto",
133133
"//google/api:api_go_proto",
134+
"//google/api:routing_go_proto",
134135
"//google/iam/v1:iam_go_proto",
135136
"//google/longrunning:longrunning_go_proto",
136137
],
@@ -141,14 +142,14 @@ go_gapic_library(
141142
srcs = [":run_proto_with_info"],
142143
grpc_service_config = "run_grpc_service_config.json",
143144
importpath = "cloud.google.com/go/run/apiv2;run",
144-
service_yaml = "run_v2.yaml",
145145
metadata = True,
146+
service_yaml = "run_v2.yaml",
146147
deps = [
147148
":run_go_proto",
148149
"//google/iam/v1:iam_go_proto",
149150
"//google/longrunning:longrunning_go_proto",
150-
"@com_google_cloud_go//longrunning/autogen:go_default_library",
151151
"@com_google_cloud_go//longrunning:go_default_library",
152+
"@com_google_cloud_go//longrunning/autogen:go_default_library",
152153
"@io_bazel_rules_go//proto/wkt:duration_go_proto",
153154
],
154155
)
@@ -165,8 +166,8 @@ go_gapic_assembly_pkg(
165166
name = "gapi-cloud-run-v2-go",
166167
deps = [
167168
":run_go_gapic",
168-
":run_go_gapic_srcjar-test.srcjar",
169169
":run_go_gapic_srcjar-metadata.srcjar",
170+
":run_go_gapic_srcjar-test.srcjar",
170171
":run_go_proto",
171172
],
172173
)
@@ -184,6 +185,7 @@ py_gapic_library(
184185
name = "run_py_gapic",
185186
srcs = [":run_proto"],
186187
grpc_service_config = "run_grpc_service_config.json",
188+
service_yaml = "run_v2.yaml",
187189
)
188190

189191
# Open Source Packages
@@ -270,8 +272,8 @@ nodejs_gapic_assembly_pkg(
270272
##############################################################################
271273
load(
272274
"@com_google_googleapis_imports//:imports.bzl",
273-
"ruby_gapic_assembly_pkg",
274275
"ruby_cloud_gapic_library",
276+
"ruby_gapic_assembly_pkg",
275277
"ruby_grpc_library",
276278
"ruby_proto_library",
277279
)
@@ -291,10 +293,10 @@ ruby_cloud_gapic_library(
291293
name = "run_ruby_gapic",
292294
srcs = [":run_proto_with_info"],
293295
extra_protoc_parameters = [
294-
"ruby-cloud-gem-name=google-cloud-run-v2",
295-
"ruby-cloud-product-url=https://cloud.google.com/run/",
296296
"ruby-cloud-api-id=run.googleapis.com",
297297
"ruby-cloud-api-shortname=run",
298+
"ruby-cloud-gem-name=google-cloud-run-v2",
299+
"ruby-cloud-product-url=https://cloud.google.com/run/",
298300
],
299301
grpc_service_config = "run_grpc_service_config.json",
300302
ruby_cloud_description = "Cloud Run deploys and manages user provided container images that scale automatically based on incoming requests.",

google/cloud/run/v2/condition.proto

Lines changed: 2 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,12 @@ message Condition {
6666
// Reason unknown. Further details will be in message.
6767
UNKNOWN = 1;
6868

69-
// The internal route is missing.
70-
ROUTE_MISSING = 2;
71-
7269
// Revision creation process failed.
7370
REVISION_FAILED = 3;
7471

7572
// Timed out waiting for completion.
7673
PROGRESS_DEADLINE_EXCEEDED = 4;
7774

78-
// There was a build error.
79-
BUILD_STEP_FAILED = 5;
80-
8175
// The container image path is incorrect.
8276
CONTAINER_MISSING = 6;
8377

@@ -107,58 +101,9 @@ message Condition {
107101

108102
// System will retry later; current attempt failed.
109103
POSTPONED_RETRY = 15;
110-
}
111-
112-
// Reasons applicable to internal resources not exposed to users. These will
113-
// surface in Service.conditions, and could be useful for further diagnosis.
114-
enum InternalReason {
115-
// Default value.
116-
INTERNAL_REASON_UNDEFINED = 0;
117-
118-
// The revision name provided conflicts with an existing one.
119-
CONFLICTING_REVISION_NAME = 1;
120-
121-
// Revision is missing; this is usually a transient reason.
122-
REVISION_MISSING = 2;
123-
124-
// Internal configuration is missing; this is usually a transient reason.
125-
CONFIGURATION_MISSING = 3;
126-
127-
// Assigning traffic; this is a transient reason.
128-
ASSIGNING_TRAFFIC = 4;
129-
130-
// Updating ingress traffic settings; this is a transient reason.
131-
UPDATING_INGRESS_TRAFFIC_ALLOWED = 5;
132-
133-
// The revision can't be created because it violates an org policy setting.
134-
REVISION_ORG_POLICY_VIOLATION = 6;
135104

136-
// Enabling GCFv2 URI support; this is a transient reason.
137-
ENABLING_GCFV2_URI_SUPPORT = 7;
138-
}
139-
140-
// Reasons specific to DomainMapping resource.
141-
enum DomainMappingReason {
142-
// Default value.
143-
DOMAIN_MAPPING_REASON_UNDEFINED = 0;
144-
145-
// Internal route is not yet ready.
146-
ROUTE_NOT_READY = 1;
147-
148-
// Insufficient permissions.
149-
PERMISSION_DENIED = 2;
150-
151-
// Certificate already exists.
152-
CERTIFICATE_ALREADY_EXISTS = 3;
153-
154-
// Mapping already exists.
155-
MAPPING_ALREADY_EXISTS = 4;
156-
157-
// Certificate issuance pending.
158-
CERTIFICATE_PENDING = 5;
159-
160-
// Certificate issuance failed.
161-
CERTIFICATE_FAILED = 6;
105+
// An internal error occurred. Further information may be in the message.
106+
INTERNAL = 16;
162107
}
163108

164109
// Reasons specific to Revision resource.
@@ -245,12 +190,6 @@ message Condition {
245190
// A common (service-level) reason for this condition.
246191
CommonReason reason = 6;
247192

248-
// A reason for the internal condition.
249-
InternalReason internal_reason = 7;
250-
251-
// A reason for the domain mapping condition.
252-
DomainMappingReason domain_mapping_reason = 8;
253-
254193
// A reason for the revision condition.
255194
RevisionReason revision_reason = 9;
256195

google/cloud/run/v2/k8s.min.proto

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ message Container {
4949
// Name of the container specified as a DNS_LABEL.
5050
string name = 1;
5151

52-
// Required. URL of the Container image in Google Container Registry or Docker
53-
// More info: https://kubernetes.io/docs/concepts/containers/images
52+
// Required. URL of the Container image in Google Container Registry or Google Artifact
53+
// Registry. More info: https://kubernetes.io/docs/concepts/containers/images
5454
string image = 2 [(google.api.field_behavior) = REQUIRED];
5555

5656
// Entrypoint array. Not executed within a shell.
@@ -270,5 +270,5 @@ message CloudSqlInstance {
270270
// https://cloud.google.com/sql/docs/mysql/connect-run for more information on
271271
// how to connect Cloud SQL and Cloud Run. Format:
272272
// {project}:{location}:{instance}
273-
repeated string connections = 1;
273+
repeated string instances = 1;
274274
}

google/cloud/run/v2/revision.proto

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/launch_stage.proto";
2323
import "google/api/resource.proto";
24+
import "google/api/routing.proto";
2425
import "google/cloud/run/v2/condition.proto";
2526
import "google/cloud/run/v2/k8s.min.proto";
2627
import "google/cloud/run/v2/vendor_settings.proto";
@@ -43,6 +44,12 @@ service Revisions {
4344
option (google.api.http) = {
4445
get: "/v2/{name=projects/*/locations/*/services/*/revisions/*}"
4546
};
47+
option (google.api.routing) = {
48+
routing_parameters {
49+
field: "name"
50+
path_template: "projects/*/locations/{location=*}/**"
51+
}
52+
};
4653
option (google.api.method_signature) = "name";
4754
}
4855

@@ -51,6 +58,12 @@ service Revisions {
5158
option (google.api.http) = {
5259
get: "/v2/{parent=projects/*/locations/*/services/*}/revisions"
5360
};
61+
option (google.api.routing) = {
62+
routing_parameters {
63+
field: "parent"
64+
path_template: "projects/*/locations/{location=*}/**"
65+
}
66+
};
5467
option (google.api.method_signature) = "parent";
5568
}
5669

@@ -59,6 +72,12 @@ service Revisions {
5972
option (google.api.http) = {
6073
delete: "/v2/{name=projects/*/locations/*/services/*/revisions/*}"
6174
};
75+
option (google.api.routing) = {
76+
routing_parameters {
77+
field: "name"
78+
path_template: "projects/*/locations/{location=*}/**"
79+
}
80+
};
6281
option (google.api.method_signature) = "name";
6382
option (google.longrunning.operation_info) = {
6483
response_type: "Revision"
@@ -209,7 +228,7 @@ message Revision {
209228
VpcAccess vpc_access = 13;
210229

211230
// Sets the maximum number of requests that each serving instance can receive.
212-
int32 container_concurrency = 14;
231+
int32 max_instance_request_concurrency = 34;
213232

214233
// Max allowed time for an instance to respond to a request.
215234
google.protobuf.Duration timeout = 15;
@@ -226,9 +245,6 @@ message Revision {
226245
// A list of Volumes to make available to containers.
227246
repeated Volume volumes = 18;
228247

229-
// Indicates whether Confidential Cloud Run is enabled in this Revision.
230-
bool confidential = 19;
231-
232248
// The execution environment being used to host this Revision.
233249
ExecutionEnvironment execution_environment = 20;
234250

google/cloud/run/v2/revision_template.proto

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,6 @@ message RevisionTemplate {
4848
// visit https://cloud.google.com/run/docs/configuring/connecting-vpc.
4949
VpcAccess vpc_access = 6;
5050

51-
// Sets the maximum number of requests that each serving instance can receive.
52-
int32 container_concurrency = 7;
53-
5451
// Max allowed time for an instance to respond to a request.
5552
google.protobuf.Duration timeout = 8;
5653

@@ -67,9 +64,6 @@ message RevisionTemplate {
6764
// A list of Volumes to make available to containers.
6865
repeated Volume volumes = 11;
6966

70-
// Enables Confidential Cloud Run in Revisions created using this template.
71-
bool confidential = 12;
72-
7367
// The sandbox environment to host this Revision.
7468
ExecutionEnvironment execution_environment = 13;
7569

@@ -79,4 +73,7 @@ message RevisionTemplate {
7973
string encryption_key = 14 [(google.api.resource_reference) = {
8074
type: "cloudkms.googleapis.com/CryptoKey"
8175
}];
76+
77+
// Sets the maximum number of requests that each serving instance can receive.
78+
int32 max_instance_request_concurrency = 15;
8279
}

google/cloud/run/v2/service.proto

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ import "google/api/client.proto";
2121
import "google/api/field_behavior.proto";
2222
import "google/api/launch_stage.proto";
2323
import "google/api/resource.proto";
24+
import "google/api/routing.proto";
2425
import "google/cloud/run/v2/condition.proto";
2526
import "google/cloud/run/v2/revision_template.proto";
2627
import "google/cloud/run/v2/traffic_target.proto";
2728
import "google/cloud/run/v2/vendor_settings.proto";
2829
import "google/iam/v1/iam_policy.proto";
2930
import "google/iam/v1/policy.proto";
3031
import "google/longrunning/operations.proto";
31-
import "google/protobuf/field_mask.proto";
3232
import "google/protobuf/timestamp.proto";
3333

3434
option go_package = "google.golang.org/genproto/googleapis/cloud/run/v2;run";
@@ -47,6 +47,12 @@ service Services {
4747
post: "/v2/{parent=projects/*/locations/*}/services"
4848
body: "service"
4949
};
50+
option (google.api.routing) = {
51+
routing_parameters {
52+
field: "parent"
53+
path_template: "projects/*/locations/{location=*}"
54+
}
55+
};
5056
option (google.api.method_signature) = "parent,service,service_id";
5157
option (google.longrunning.operation_info) = {
5258
response_type: "Service"
@@ -59,6 +65,12 @@ service Services {
5965
option (google.api.http) = {
6066
get: "/v2/{name=projects/*/locations/*/services/*}"
6167
};
68+
option (google.api.routing) = {
69+
routing_parameters {
70+
field: "name"
71+
path_template: "projects/*/locations/{location=*}/**"
72+
}
73+
};
6274
option (google.api.method_signature) = "name";
6375
}
6476

@@ -67,6 +79,12 @@ service Services {
6779
option (google.api.http) = {
6880
get: "/v2/{parent=projects/*/locations/*}/services"
6981
};
82+
option (google.api.routing) = {
83+
routing_parameters {
84+
field: "parent"
85+
path_template: "projects/*/locations/{location=*}"
86+
}
87+
};
7088
option (google.api.method_signature) = "parent";
7189
}
7290

@@ -76,7 +94,13 @@ service Services {
7694
patch: "/v2/{service.name=projects/*/locations/*/services/*}"
7795
body: "service"
7896
};
79-
option (google.api.method_signature) = "service,update_mask";
97+
option (google.api.routing) = {
98+
routing_parameters {
99+
field: "service.name"
100+
path_template: "projects/*/locations/{location=*}/**"
101+
}
102+
};
103+
option (google.api.method_signature) = "service";
80104
option (google.longrunning.operation_info) = {
81105
response_type: "Service"
82106
metadata_type: "Service"
@@ -90,6 +114,12 @@ service Services {
90114
option (google.api.http) = {
91115
delete: "/v2/{name=projects/*/locations/*/services/*}"
92116
};
117+
option (google.api.routing) = {
118+
routing_parameters {
119+
field: "name"
120+
path_template: "projects/*/locations/{location=*}/**"
121+
}
122+
};
93123
option (google.api.method_signature) = "name";
94124
option (google.longrunning.operation_info) = {
95125
response_type: "Service"
@@ -153,9 +183,6 @@ message UpdateServiceRequest {
153183
// Required. The Service to be updated.
154184
Service service = 1 [(google.api.field_behavior) = REQUIRED];
155185

156-
// The list of fields to be updated.
157-
google.protobuf.FieldMask update_mask = 2;
158-
159186
// Indicates that the request should be validated and default values
160187
// populated, without persisting the request or updating any resources.
161188
bool validate_only = 3;
@@ -261,6 +288,8 @@ message Service {
261288

262289
// Output only. A number that monotonically increases every time the user
263290
// modifies the desired state.
291+
// Please note that unlike v1, this is an int64 value. As with most Google
292+
// APIs, its JSON representation will be a `string` instead of an `integer`.
264293
int64 generation = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
265294

266295
// Map of string keys and values that can be used to organize and categorize
@@ -333,6 +362,8 @@ message Service {
333362
// Output only. The generation of this Service currently serving traffic. See comments in
334363
// `reconciling` for additional information on reconciliation process in Cloud
335364
// Run.
365+
// Please note that unlike v1, this is an int64 value. As with most Google
366+
// APIs, its JSON representation will be a `string` instead of an `integer`.
336367
int64 observed_generation = 30 [(google.api.field_behavior) = OUTPUT_ONLY];
337368

338369
// Output only. The Condition of this Service, containing its readiness status, and

0 commit comments

Comments
 (0)