Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: [run]support update_mask in Cloud Run UpdateService #5532

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ syntax = "proto3";

package google.cloud.run.v2;

import "google/api/field_behavior.proto";
import "google/protobuf/timestamp.proto";

option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb";
Expand Down Expand Up @@ -200,13 +201,15 @@ message Condition {
// it will populate one of these fields.
// Successful conditions cannot have a reason.
oneof reasons {
// A common (service-level) reason for this condition.
CommonReason reason = 6;
// Output only. A common (service-level) reason for this condition.
CommonReason reason = 6 [(google.api.field_behavior) = OUTPUT_ONLY];

// A reason for the revision condition.
RevisionReason revision_reason = 9;
// Output only. A reason for the revision condition.
RevisionReason revision_reason = 9
[(google.api.field_behavior) = OUTPUT_ONLY];

// A reason for the execution condition.
ExecutionReason execution_reason = 11;
// Output only. A reason for the execution condition.
ExecutionReason execution_reason = 11
[(google.api.field_behavior) = OUTPUT_ONLY];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ service Executions {
option (google.api.method_signature) = "name";
}

// Lists Executions from a Job.
// Lists Executions from a Job. Results are sorted by creation time,
// descending.
rpc ListExecutions(ListExecutionsRequest) returns (ListExecutionsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/locations/*/jobs/*}/executions"
Expand Down
54 changes: 47 additions & 7 deletions packages/google-cloud-run/protos/google/cloud/run/v2/job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import "google/api/launch_stage.proto";
import "google/api/resource.proto";
import "google/api/routing.proto";
import "google/cloud/run/v2/condition.proto";
import "google/cloud/run/v2/execution.proto";
import "google/cloud/run/v2/execution_template.proto";
import "google/cloud/run/v2/k8s.min.proto";
import "google/cloud/run/v2/vendor_settings.proto";
Expand Down Expand Up @@ -77,7 +76,7 @@ service Jobs {
option (google.api.method_signature) = "name";
}

// Lists Jobs.
// Lists Jobs. Results are sorted by creation time, descending.
rpc ListJobs(ListJobsRequest) returns (ListJobsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/locations/*}/jobs"
Expand Down Expand Up @@ -220,10 +219,10 @@ message UpdateJobRequest {
// populated, without persisting the request or updating any resources.
bool validate_only = 3;

// If set to true, and if the Job does not exist, it will create a new
// one. Caller must have both create and update permissions for this call if
// this is set to true.
bool allow_missing = 4;
// Optional. If set to true, and if the Job does not exist, it will create a
// new one. Caller must have both create and update permissions for this call
// if this is set to true.
bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL];
}

// Request message for retrieving a list of Jobs.
Expand Down Expand Up @@ -391,7 +390,8 @@ message Job {
google.protobuf.Timestamp update_time = 7
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. The deletion time.
// Output only. The deletion time. It is only populated as a response to a
// Delete request.
google.protobuf.Timestamp delete_time = 8
[(google.api.field_behavior) = OUTPUT_ONLY];

Expand Down Expand Up @@ -478,6 +478,18 @@ message Job {
// Output only. Reserved for future use.
bool satisfies_pzs = 25 [(google.api.field_behavior) = OUTPUT_ONLY];

oneof create_execution {
// A unique string used as a suffix creating a new execution. The Job will
// become ready when the execution is successfully started.
// The sum of job name and token length must be fewer than 63 characters.
string start_execution_token = 26;

// A unique string used as a suffix for creating a new execution. The Job
// will become ready when the execution is successfully completed.
// The sum of job name and token length must be fewer than 63 characters.
string run_execution_token = 27;
}

// Output only. A system-generated fingerprint for this version of the
// resource. May be used to detect modification conflict during updates.
string etag = 99 [(google.api.field_behavior) = OUTPUT_ONLY];
Expand All @@ -486,6 +498,27 @@ message Job {
// Reference to an Execution. Use /Executions.GetExecution with the given name
// to get full execution including the latest status.
message ExecutionReference {
// Possible execution completion status.
enum CompletionStatus {
// The default value. This value is used if the state is omitted.
COMPLETION_STATUS_UNSPECIFIED = 0;

// Job execution has succeeded.
EXECUTION_SUCCEEDED = 1;

// Job execution has failed.
EXECUTION_FAILED = 2;

// Job execution is running normally.
EXECUTION_RUNNING = 3;

// Waiting for backing resources to be provisioned.
EXECUTION_PENDING = 4;

// Job execution has been cancelled by the user.
EXECUTION_CANCELLED = 5;
}

// Name of the execution.
string name = 1 [
(google.api.resource_reference) = { type: "run.googleapis.com/Execution" }
Expand All @@ -496,4 +529,11 @@ message ExecutionReference {

// Creation timestamp of the execution.
google.protobuf.Timestamp completion_time = 3;

// The deletion time of the execution. It is only
// populated as a response to a Delete request.
google.protobuf.Timestamp delete_time = 5;

// Status for the execution completion.
CompletionStatus completion_status = 4;
}
Original file line number Diff line number Diff line change
Expand Up @@ -338,98 +338,100 @@ message NFSVolumeSource {
// Path that is exported by the NFS server.
string path = 2;

// If true, mount the NFS volume as read only
// If true, the volume will be mounted as read only for all mounts.
bool read_only = 3;
}

// Represents a GCS Bucket mounted as a volume.
// Represents a volume backed by a Cloud Storage bucket using Cloud Storage
// FUSE.
message GCSVolumeSource {
// GCS Bucket name
// Cloud Storage Bucket name.
string bucket = 1;

// If true, mount the GCS bucket as read-only
// If true, the volume will be mounted as read only for all mounts.
bool read_only = 2;
}

// Probe describes a health check to be performed against a container to
// determine whether it is alive or ready to receive traffic.
message Probe {
// Number of seconds after the container has started before the probe is
// initiated.
// Defaults to 0 seconds. Minimum value is 0. Maximum value for liveness probe
// is 3600. Maximum value for startup probe is 240.
int32 initial_delay_seconds = 1;
// Optional. Number of seconds after the container has started before the
// probe is initiated. Defaults to 0 seconds. Minimum value is 0. Maximum
// value for liveness probe is 3600. Maximum value for startup probe is 240.
int32 initial_delay_seconds = 1 [(google.api.field_behavior) = OPTIONAL];

// Number of seconds after which the probe times out.
// Optional. Number of seconds after which the probe times out.
// Defaults to 1 second. Minimum value is 1. Maximum value is 3600.
// Must be smaller than period_seconds.
int32 timeout_seconds = 2;
int32 timeout_seconds = 2 [(google.api.field_behavior) = OPTIONAL];

// How often (in seconds) to perform the probe.
// Optional. How often (in seconds) to perform the probe.
// Default to 10 seconds. Minimum value is 1. Maximum value for liveness probe
// is 3600. Maximum value for startup probe is 240.
// Must be greater or equal than timeout_seconds.
int32 period_seconds = 3;
int32 period_seconds = 3 [(google.api.field_behavior) = OPTIONAL];

// Minimum consecutive failures for the probe to be considered failed after
// having succeeded. Defaults to 3. Minimum value is 1.
int32 failure_threshold = 4;
// Optional. Minimum consecutive failures for the probe to be considered
// failed after having succeeded. Defaults to 3. Minimum value is 1.
int32 failure_threshold = 4 [(google.api.field_behavior) = OPTIONAL];

oneof probe_type {
// HTTPGet specifies the http request to perform.
// Optional. HTTPGet specifies the http request to perform.
// Exactly one of httpGet, tcpSocket, or grpc must be specified.
HTTPGetAction http_get = 5;
HTTPGetAction http_get = 5 [(google.api.field_behavior) = OPTIONAL];

// TCPSocket specifies an action involving a TCP port.
// Optional. TCPSocket specifies an action involving a TCP port.
// Exactly one of httpGet, tcpSocket, or grpc must be specified.
TCPSocketAction tcp_socket = 6;
TCPSocketAction tcp_socket = 6 [(google.api.field_behavior) = OPTIONAL];

// GRPC specifies an action involving a gRPC port.
// Optional. GRPC specifies an action involving a gRPC port.
// Exactly one of httpGet, tcpSocket, or grpc must be specified.
GRPCAction grpc = 7;
GRPCAction grpc = 7 [(google.api.field_behavior) = OPTIONAL];
}
}

// HTTPGetAction describes an action based on HTTP Get requests.
message HTTPGetAction {
// Path to access on the HTTP server. Defaults to '/'.
string path = 1;
// Optional. Path to access on the HTTP server. Defaults to '/'.
string path = 1 [(google.api.field_behavior) = OPTIONAL];

// Custom headers to set in the request. HTTP allows repeated headers.
repeated HTTPHeader http_headers = 4;
// Optional. Custom headers to set in the request. HTTP allows repeated
// headers.
repeated HTTPHeader http_headers = 4 [(google.api.field_behavior) = OPTIONAL];

// Port number to access on the container. Must be in the range 1 to 65535.
// If not specified, defaults to the exposed port of the container, which is
// the value of container.ports[0].containerPort.
int32 port = 5;
// Optional. Port number to access on the container. Must be in the range 1 to
// 65535. If not specified, defaults to the exposed port of the container,
// which is the value of container.ports[0].containerPort.
int32 port = 5 [(google.api.field_behavior) = OPTIONAL];
}

// HTTPHeader describes a custom header to be used in HTTP probes
message HTTPHeader {
// Required. The header field name
string name = 1 [(google.api.field_behavior) = REQUIRED];

// The header field value
string value = 2;
// Optional. The header field value
string value = 2 [(google.api.field_behavior) = OPTIONAL];
}

// TCPSocketAction describes an action based on opening a socket
message TCPSocketAction {
// Port number to access on the container. Must be in the range 1 to 65535.
// If not specified, defaults to the exposed port of the container, which is
// the value of container.ports[0].containerPort.
int32 port = 1;
// Optional. Port number to access on the container. Must be in the range 1 to
// 65535. If not specified, defaults to the exposed port of the container,
// which is the value of container.ports[0].containerPort.
int32 port = 1 [(google.api.field_behavior) = OPTIONAL];
}

// GRPCAction describes an action involving a GRPC port.
message GRPCAction {
// Port number of the gRPC service. Number must be in the range 1 to 65535.
// If not specified, defaults to the exposed port of the container, which is
// the value of container.ports[0].containerPort.
int32 port = 1;

// 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 ). If
// this is not specified, the default behavior is defined by gRPC.
string service = 2;
// Optional. Port number of the gRPC service. Number must be in the range 1 to
// 65535. If not specified, defaults to the exposed port of the container,
// which is the value of container.ports[0].containerPort.
int32 port = 1 [(google.api.field_behavior) = OPTIONAL];

// Optional. 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 ). If this
// is not specified, the default behavior is defined by gRPC.
string service = 2 [(google.api.field_behavior) = OPTIONAL];
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ service Revisions {
option (google.api.method_signature) = "name";
}

// Lists Revisions from a given Service, or from a given location.
// Lists Revisions from a given Service, or from a given location. Results
// are sorted by creation time, descending.
rpc ListRevisions(ListRevisionsRequest) returns (ListRevisionsResponse) {
option (google.api.http) = {
get: "/v2/{parent=projects/*/locations/*/services/*}/revisions"
Expand Down
Loading
Loading