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

Add annotations support for v2 Cloud Run Job resource #8176

Merged
merged 1 commit into from
Jun 21, 2023
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
41 changes: 29 additions & 12 deletions mmv1/products/cloudrunv2/Job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,20 @@ properties:
- !ruby/object:Api::Type::KeyValuePairs
name: 'labels'
description: |-
KRM-style labels for the resource. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels Cloud Run will populate some labels with 'run.googleapis.com' or 'serving.knative.dev' namespaces. Those labels are read-only, and user changes will not be preserved.
# blocked on b/244872932
# - !ruby/object:Api::Type::KeyValuePairs
# name: "annotations"
# description: |-
# KRM-style annotations for the resource. Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects. Cloud Run will populate some annotations using 'run.googleapis.com' or 'serving.knative.dev' namespaces. This field follows Kubernetes annotations' namespacing, limits, and rules. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations
Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component,
environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
All system labels in v1 now have a corresponding field in v2 Job.
- !ruby/object:Api::Type::KeyValuePairs
name: "annotations"
description: |-
Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected on new resources.
All system annotations in v1 now have a corresponding field in v2 Job.

This field follows Kubernetes annotations' namespacing, limits, and rules.
- !ruby/object:Api::Type::String
name: 'client'
description: |
Expand Down Expand Up @@ -184,12 +192,21 @@ properties:
- !ruby/object:Api::Type::KeyValuePairs
name: 'labels'
description: |-
KRM-style labels for the resource.
# blocked on b/244872932
# - !ruby/object:Api::Type::KeyValuePairs
# name: "annotations"
# description: |-
# KRM-style annotations for the resource.
Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter,
or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or
https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
All system labels in v1 now have a corresponding field in v2 ExecutionTemplate.
- !ruby/object:Api::Type::KeyValuePairs
name: "annotations"
description: |-
Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
All system annotations in v1 now have a corresponding field in v2 ExecutionTemplate.

This field follows Kubernetes annotations' namespacing, limits, and rules.
- !ruby/object:Api::Type::Integer
name: 'parallelism'
description: |-
Expand Down
26 changes: 22 additions & 4 deletions mmv1/products/cloudrunv2/Service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,20 @@ properties:
- !ruby/object:Api::Type::KeyValuePairs
name: 'labels'
description: |-
Map of string keys and values that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels Cloud Run will populate some labels with 'run.googleapis.com' or 'serving.knative.dev' namespaces. Those labels are read-only, and user changes will not be preserved.
Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component,
environment, state, etc. For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
All system labels in v1 now have a corresponding field in v2 Service.
- !ruby/object:Api::Type::KeyValuePairs
name: 'annotations'
description: |-
Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects. Cloud Run will populate some annotations using 'run.googleapis.com' or 'serving.knative.dev' namespaces. This field follows Kubernetes annotations' namespacing, limits, and rules. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations
Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected in new resources.
All system annotations in v1 now have a corresponding field in v2 Service.

This field follows Kubernetes annotations' namespacing, limits, and rules.
- !ruby/object:Api::Type::String
name: 'client'
description: |
Expand Down Expand Up @@ -211,11 +220,20 @@ properties:
- !ruby/object:Api::Type::KeyValuePairs
name: 'labels'
description: |-
KRM-style labels for the resource.
Unstructured key value map that can be used to organize and categorize objects. User-provided labels are shared with Google's billing system, so they can be used to filter, or break down billing charges by team, component, environment, state, etc.
For more information, visit https://cloud.google.com/resource-manager/docs/creating-managing-labels or https://cloud.google.com/run/docs/configuring/labels.

Cloud Run API v2 does not support labels with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
All system labels in v1 now have a corresponding field in v2 RevisionTemplate.
- !ruby/object:Api::Type::KeyValuePairs
name: 'annotations'
description: |-
KRM-style annotations for the resource.
Unstructured key value map that may be set by external tools to store and arbitrary metadata. They are not queryable and should be preserved when modifying objects.

Cloud Run API v2 does not support annotations with `run.googleapis.com`, `cloud.googleapis.com`, `serving.knative.dev`, or `autoscaling.knative.dev` namespaces, and they will be rejected.
All system annotations in v1 now have a corresponding field in v2 RevisionTemplate.

This field follows Kubernetes annotations' namespacing, limits, and rules.
- !ruby/object:Api::Type::NestedObject
name: 'scaling'
description: |
Expand Down
12 changes: 12 additions & 0 deletions mmv1/third_party/terraform/tests/resource_cloud_run_v2_job_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,19 @@ func testAccCloudRunV2Job_cloudrunv2JobFull(context map[string]interface{}) stri
labels = {
label-1 = "value-1"
}
annotations = {
job-annotation-1 = "job-value-1"
}
client = "client-1"
client_version = "client-version-1"

template {
labels = {
label-1 = "value-1"
}
annotations = {
temp-annotation-1 = "temp-value-1"
}
parallelism = 4
task_count = 4
template {
Expand Down Expand Up @@ -115,13 +121,19 @@ resource "google_cloud_run_v2_job" "default" {
labels = {
label-1 = "value-update"
}
annotations = {
job-annotation-1 = "job-value-update"
}
client = "client-update"
client_version = "client-version-update"

template {
labels = {
label-1 = "value-update"
}
annotations = {
temp-annotation-1 = "temp-value-update"
}
parallelism = 2
task_count = 8
template {
Expand Down