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

fix: [run] Removes accidentally exposed field service.traffic_tags_cleanup_threshold in Cloud Run Service #4697

Merged
merged 7 commits into from
Sep 28, 2023
1 change: 1 addition & 0 deletions packages/google-cloud-run/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/google-cloud-node/

| Sample | Source Code | Try it |
| --------------------------- | --------------------------------- | ------ |
| Executions.cancel_execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-run/samples/generated/v2/executions.cancel_execution.js,packages/google-cloud-run/samples/README.md) |
| Executions.delete_execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-run/samples/generated/v2/executions.delete_execution.js,packages/google-cloud-run/samples/README.md) |
| Executions.get_execution | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.get_execution.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-run/samples/generated/v2/executions.get_execution.js,packages/google-cloud-run/samples/README.md) |
| Executions.list_executions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-run/samples/generated/v2/executions.list_executions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/google-cloud-node&page=editor&open_in_editor=packages/google-cloud-run/samples/generated/v2/executions.list_executions.js,packages/google-cloud-run/samples/README.md) |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,9 @@ message Condition {

// The execution is in the process of being cancelled.
CANCELLING = 4;

// The execution was deleted.
DELETED = 5;
}

// type is used to communicate the status of the reconciliation process.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,28 @@ service Executions {
metadata_type: "Execution"
};
}

// Cancels an Execution.
rpc CancelExecution(CancelExecutionRequest)
returns (google.longrunning.Operation) {
option (google.api.http) = {
post: "/v2/{name=projects/*/locations/*/jobs/*/executions/*}:cancel"
body: "*"
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "Execution"
metadata_type: "Execution"
};
}
}

// Request message for obtaining a Execution by its full name.
message GetExecutionRequest {
// Required. The full name of the Execution.
// Format:
// projects/{project}/locations/{location}/jobs/{job}/executions/{execution},
// where {project} can be project id or number.
// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
// where `{project}` can be project id or number.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "run.googleapis.com/Execution" }
Expand All @@ -83,8 +97,8 @@ message GetExecutionRequest {
message ListExecutionsRequest {
// Required. The Execution from which the Executions should be listed.
// To list all Executions across Jobs, use "-" instead of Job name.
// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
// can be project id or number.
// Format: `projects/{project}/locations/{location}/jobs/{job}`, where
// `{project}` can be project id or number.
string parent = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = {
Expand Down Expand Up @@ -117,8 +131,8 @@ message ListExecutionsResponse {
message DeleteExecutionRequest {
// Required. The name of the Execution to delete.
// Format:
// projects/{project}/locations/{location}/jobs/{job}/executions/{execution},
// where {project} can be project id or number.
// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
// where `{project}` can be project id or number.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "run.googleapis.com/Execution" }
Expand All @@ -133,6 +147,26 @@ message DeleteExecutionRequest {
string etag = 3;
}

// Request message for deleting an Execution.
message CancelExecutionRequest {
// Required. The name of the Execution to cancel.
// Format:
// `projects/{project}/locations/{location}/jobs/{job}/executions/{execution}`,
// where `{project}` can be project id or number.
string name = 1 [
(google.api.field_behavior) = REQUIRED,
(google.api.resource_reference) = { type: "run.googleapis.com/Execution" }
];

// Indicates that the request should be validated without actually
// cancelling any resources.
bool validate_only = 2;

// A system-generated fingerprint for this version of the resource.
// This may be used to detect modification conflict during updates.
string etag = 3;
}

// Execution represents the configuration of a single execution. A execution an
// immutable resource that references a container image which is run to
// completion.
Expand Down
75 changes: 75 additions & 0 deletions packages/google-cloud-run/protos/google/cloud/run/v2/job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,16 @@ import "google/api/client.proto";
import "google/api/field_behavior.proto";
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";
import "google/iam/v1/iam_policy.proto";
import "google/iam/v1/policy.proto";
import "google/longrunning/operations.proto";
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";

option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb";
Expand All @@ -47,6 +50,12 @@ service Jobs {
post: "/v2/{parent=projects/*/locations/*}/jobs"
body: "job"
};
option (google.api.routing) = {
routing_parameters {
field: "parent"
path_template: "projects/*/locations/{location=*}"
}
};
option (google.api.method_signature) = "parent,job,job_id";
option (google.longrunning.operation_info) = {
response_type: "Job"
Expand All @@ -59,6 +68,12 @@ service Jobs {
option (google.api.http) = {
get: "/v2/{name=projects/*/locations/*/jobs/*}"
};
option (google.api.routing) = {
routing_parameters {
field: "name"
path_template: "projects/*/locations/{location=*}/**"
}
};
option (google.api.method_signature) = "name";
}

Expand All @@ -67,6 +82,12 @@ service Jobs {
option (google.api.http) = {
get: "/v2/{parent=projects/*/locations/*}/jobs"
};
option (google.api.routing) = {
routing_parameters {
field: "parent"
path_template: "projects/*/locations/{location=*}"
}
};
option (google.api.method_signature) = "parent";
}

Expand All @@ -76,6 +97,12 @@ service Jobs {
patch: "/v2/{job.name=projects/*/locations/*/jobs/*}"
body: "job"
};
option (google.api.routing) = {
routing_parameters {
field: "job.name"
path_template: "projects/*/locations/{location=*}/**"
}
};
option (google.api.method_signature) = "job";
option (google.longrunning.operation_info) = {
response_type: "Job"
Expand All @@ -88,6 +115,12 @@ service Jobs {
option (google.api.http) = {
delete: "/v2/{name=projects/*/locations/*/jobs/*}"
};
option (google.api.routing) = {
routing_parameters {
field: "name"
path_template: "projects/*/locations/{location=*}/**"
}
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "Job"
Expand All @@ -101,6 +134,12 @@ service Jobs {
post: "/v2/{name=projects/*/locations/*/jobs/*}:run"
body: "*"
};
option (google.api.routing) = {
routing_parameters {
field: "name"
path_template: "projects/*/locations/{location=*}/**"
}
};
option (google.api.method_signature) = "name";
option (google.longrunning.operation_info) = {
response_type: "Execution"
Expand Down Expand Up @@ -239,6 +278,38 @@ message DeleteJobRequest {

// Request message to create a new Execution of a Job.
message RunJobRequest {
// RunJob Overrides that contains Execution fields to be overridden.
message Overrides {
// Per-container override specification.
message ContainerOverride {
// The name of the container specified as a DNS_LABEL.
string name = 1;

// Optional. Arguments to the entrypoint. Will replace existing args for
// override.
repeated string args = 2 [(google.api.field_behavior) = OPTIONAL];

// List of environment variables to set in the container. Will be merged
// with existing env for override.
repeated EnvVar env = 3;

// Optional. True if the intention is to clear out existing args list.
bool clear_args = 4 [(google.api.field_behavior) = OPTIONAL];
}

// Per container override specification.
repeated ContainerOverride container_overrides = 1;

// Optional. The desired number of tasks the execution should run. Will
// replace existing task_count value.
int32 task_count = 2 [(google.api.field_behavior) = OPTIONAL];

// Duration in seconds the task may be active before the system will
// actively try to mark it failed and kill associated containers. Will
// replace existing timeout_seconds value.
google.protobuf.Duration timeout = 4;
}

// Required. The full name of the Job.
// Format: projects/{project}/locations/{location}/jobs/{job}, where {project}
// can be project id or number.
Expand All @@ -254,6 +325,10 @@ message RunJobRequest {
// A system-generated fingerprint for this version of the
// resource. May be used to detect modification conflict during updates.
string etag = 3;

// Overrides specification for a given execution of a job. If provided,
// overrides will be applied to update the execution or task spec.
Overrides overrides = 4;
}

// Job represents the configuration of a single job, which references a
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ option (google.api.resource_definition) = {
// A single application container.
// This specifies both the container to run, the command to run in the container
// and the arguments to supply to it.
// Note that additional arguments may be supplied by the system to the container
// Note that additional arguments can be supplied by the system to the container
// at runtime.
message Container {
// Name of the container specified as a DNS_LABEL (RFC 1123).
Expand Down Expand Up @@ -93,6 +93,9 @@ message Container {
// succeeds. Container will not be added to service endpoints if the probe
// fails.
Probe startup_probe = 11;

// Names of the containers that must start before this container.
repeated string depends_on = 12;
}

// ResourceRequirements describes the compute resource requirements.
Expand All @@ -118,8 +121,8 @@ message ResourceRequirements {

// EnvVar represents an environment variable present in a Container.
message EnvVar {
// Required. Name of the environment variable. Must be a C_IDENTIFIER, and
// mnay not exceed 32768 characters.
// Required. Name of the environment variable. Must not exceed 32768
// characters.
string name = 1 [(google.api.field_behavior) = REQUIRED];

oneof values {
Expand Down Expand Up @@ -202,6 +205,9 @@ message Volume {
// mounted. Visit https://cloud.google.com/sql/docs/mysql/connect-run for
// more information on how to connect Cloud SQL and Cloud Run.
CloudSqlInstance cloud_sql_instance = 3;

// Ephemeral storage used as a shared volume.
EmptyDirVolumeSource empty_dir = 4;
}
}

Expand Down Expand Up @@ -285,6 +291,37 @@ message CloudSqlInstance {
repeated string instances = 1;
}

// In memory (tmpfs) ephemeral storage.
// It is ephemeral in the sense that when the sandbox is taken down, the data is
// destroyed with it (it does not persist across sandbox runs).
message EmptyDirVolumeSource {
// The different types of medium supported for EmptyDir.
enum Medium {
// When not specified, falls back to the default implementation which
// is currently in memory (this may change over time).
MEDIUM_UNSPECIFIED = 0;

// Explicitly set the EmptyDir to be in memory. Uses tmpfs.
MEMORY = 1;
}

// The medium on which the data is stored. Acceptable values today is only
// MEMORY or none. When none, the default will currently be backed by memory
// but could change over time. +optional
Medium medium = 1;

// Limit on the storage usable by this EmptyDir volume.
// The size limit is also applicable for memory medium.
// The maximum usage on memory medium EmptyDir would be the minimum value
// between the SizeLimit specified here and the sum of memory limits of all
// containers. The default is nil which means that the limit is undefined.
// More info:
// https://cloud.google.com/run/docs/configuring/in-memory-volumes#configure-volume.
// Info in Kubernetes:
// https://kubernetes.io/docs/concepts/storage/volumes/#emptydir
string size_limit = 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 {
Expand Down Expand Up @@ -363,7 +400,7 @@ message GRPCAction {
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
// (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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -133,12 +133,18 @@ message Task {
map<string, string> annotations = 5
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Represents time when the task was created by the job
// controller. It is not guaranteed to be set in happens-before order across
// separate operations.
// Output only. Represents time when the task was created by the system.
// It is not guaranteed to be set in happens-before order across separate
// operations.
google.protobuf.Timestamp create_time = 6
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Represents time when the task was scheduled to run by the
// system. It is not guaranteed to be set in happens-before order across
// separate operations.
google.protobuf.Timestamp scheduled_time = 34
[(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. Represents time when the task started to run.
// It is not guaranteed to be set in happens-before order across separate
// operations.
Expand Down
Loading