Skip to content

Commit

Permalink
Apply new labels model to more resources (part 3)
Browse files Browse the repository at this point in the history
  • Loading branch information
zli82016 committed Sep 18, 2023
1 parent 6a4849d commit ced30ad
Show file tree
Hide file tree
Showing 39 changed files with 215 additions and 81 deletions.
2 changes: 1 addition & 1 deletion mmv1/products/privateca/Certificate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ properties:
omitted, no template will be used. This template must be in the same location
as the Certificate.
diff_suppress_func: 'tpgresource.CompareResourceNames'
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
Labels with user-defined metadata to apply to this resource.
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/pubsub/Subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ properties:
pattern: 'projects/{{project}}/topics/{{topic}}'
diff_suppress_func: 'tpgresource.CompareSelfLinkOrResourceName'
custom_expand: templates/terraform/custom_expand/computed_subscription_topic.erb
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
A set of key/value label pairs to assign to this Subscription.
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/pubsub/Topic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ properties:
(`service-{{PROJECT_NUMBER}}@gcp-sa-pubsub.iam.gserviceaccount.com`) must have
`roles/cloudkms.cryptoKeyEncrypterDecrypter` to use this feature.
The expected format is `projects/*/locations/*/keyRings/*/cryptoKeys/*`
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
A set of key/value label pairs to assign to this Topic.
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/redis/Instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ properties:
Hostname or IP address of the exposed Redis endpoint used by clients
to connect to the service.
output: true
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: Resource labels to represent user provided metadata.
- !ruby/object:Api::Type::KeyValuePairs
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/servicedirectory/Namespace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ properties:
The resource name for the namespace
in the format `projects/*/locations/*/namespaces/*`.
output: true
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
Resource labels associated with this Namespace. No more than 64 user
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/spanner/Instance.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ properties:
- num_nodes
- processing_units
default_from_api: true
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
An object containing a list of "key": value pairs.
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/storage/Bucket.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ properties:
object is missing, if applicable, the service will return the
named object from this bucket as the content for a 404 Not Found
result.
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
Labels applied to this bucket. A list of key->value pairs.
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/tpu/Node.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ properties:
output: true
description: |
The port of this network endpoint.
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
immutable: true
description: Resource labels to represent user provided metadata.
3 changes: 1 addition & 2 deletions mmv1/products/vertexai/Dataset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,10 @@ properties:
output: true
description: |
The timestamp of when the dataset was last updated in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
A set of key/value label pairs to assign to this Workflow.
default_from_api: true
- !ruby/object:Api::Type::NestedObject
name: 'encryptionSpec'
immutable: true
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/vertexai/Featurestore.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ properties:
output: true
description: |
The timestamp of when the featurestore was last updated in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
A set of key/value label pairs to assign to this Featurestore.
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/vertexai/FeaturestoreEntitytype.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ properties:
output: true
description: |
The timestamp of when the featurestore was last updated in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
A set of key/value label pairs to assign to this EntityType.
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/vertexai/FeaturestoreEntitytypeFeature.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ properties:
output: true
description: |
The timestamp when the entity type was most recently updated in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
A set of key/value label pairs to assign to the feature.
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/vertexai/Index.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ properties:
description: Used to perform consistent read-modify-write updates.
output: true
ignore_read: true
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: The labels with user-defined metadata to organize your Indexes.
- !ruby/object:Api::Type::String
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/vertexai/IndexEndpoint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ properties:
description: Used to perform consistent read-modify-write updates.
output: true
ignore_read: true
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: The labels with user-defined metadata to organize your Indexes.
- !ruby/object:Api::Type::String
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/vertexai/Tensorboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ properties:
output: true
description: |
The timestamp of when the Tensorboard was last updated in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits.
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
The labels with user-defined metadata to organize your Tensorboards.
2 changes: 1 addition & 1 deletion mmv1/products/workflows/Workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ properties:
name: 'state'
output: true
description: State of the workflow deployment.
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description: |
A set of key/value label pairs to assign to this Workflow.
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/workstations/Workstation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ properties:
name: 'displayName'
description: |
Human-readable name for this resource.
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description:
'Client-specified labels that are applied to the resource and that are
Expand Down
2 changes: 1 addition & 1 deletion mmv1/products/workstations/WorkstationConfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ properties:
name: 'displayName'
description: |
Human-readable name for this resource.
- !ruby/object:Api::Type::KeyValuePairs
- !ruby/object:Api::Type::KeyValueLabels
name: 'labels'
description:
'Client-specified labels that are applied to the resource and that are
Expand Down
4 changes: 4 additions & 0 deletions mmv1/templates/terraform/examples/vertex_ai_dataset.tf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ resource "google_vertex_ai_dataset" "dataset" {
display_name = "<%= ctx[:vars]['display_name'] %>"
metadata_schema_uri = "gs://google-cloud-aiplatform/schema/dataset/metadata/image_1.0.0.yaml"
region = "us-central1"

labels = {
env = "test"
}
}
3 changes: 3 additions & 0 deletions mmv1/templates/terraform/examples/workflow_basic.tf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ resource "google_workflows_workflow" "<%= ctx[:primary_resource_id] %>" {
region = "us-central1"
description = "Magic"
service_account = google_service_account.test_account.id
labels = {
env = "test"
}
source_contents = <<-EOF
# This is a sample workflow. You can replace it with your source code.
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ resource "google_workstations_workstation_config" "<%= ctx[:primary_resource_id]
label-one = "value-one"
}

labels = {
"label" = "key"
}

host {
gce_instance {
machine_type = "e2-standard-4"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestAccPrivatecaCertificate_privatecaCertificateUpdate(t *testing.T) {
ResourceName: "google_privateca_certificate.default",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"pool", "name", "location", "certificate_authority"},
ImportStateVerifyIgnore: []string{"pool", "name", "location", "certificate_authority", "labels", "terraform_labels"},
},
{
Config: testAccPrivatecaCertificate_privatecaCertificateStart(context),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ func TestAccPubsubSubscription_basic(t *testing.T) {
Config: testAccPubsubSubscription_basic(topic, subscription, "bar", 20, false),
},
{
ResourceName: "google_pubsub_subscription.foo",
ImportStateId: subscription,
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_pubsub_subscription.foo",
ImportStateId: subscription,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
},
})
Expand All @@ -75,19 +76,21 @@ func TestAccPubsubSubscription_update(t *testing.T) {
Config: testAccPubsubSubscription_basic(topic, subscriptionShort, "bar", 20, false),
},
{
ResourceName: "google_pubsub_subscription.foo",
ImportStateId: subscriptionShort,
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_pubsub_subscription.foo",
ImportStateId: subscriptionShort,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
{
Config: testAccPubsubSubscription_basic(topic, subscriptionShort, "baz", 30, true),
},
{
ResourceName: "google_pubsub_subscription.foo",
ImportStateId: subscriptionShort,
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_pubsub_subscription.foo",
ImportStateId: subscriptionShort,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,21 @@ func TestAccPubsubTopic_update(t *testing.T) {
Config: testAccPubsubTopic_update(topic, "foo", "bar"),
},
{
ResourceName: "google_pubsub_topic.foo",
ImportStateId: topic,
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_pubsub_topic.foo",
ImportStateId: topic,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
{
Config: testAccPubsubTopic_updateWithRegion(topic, "wibble", "wobble", "us-central1"),
},
{
ResourceName: "google_pubsub_topic.foo",
ImportStateId: topic,
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_pubsub_topic.foo",
ImportStateId: topic,
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,19 @@ func TestAccRedisInstance_update(t *testing.T) {
Config: testAccRedisInstance_update(name, true),
},
{
ResourceName: "google_redis_instance.test",
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_redis_instance.test",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
{
Config: testAccRedisInstance_update2(name, true),
},
{
ResourceName: "google_redis_instance.test",
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_redis_instance.test",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
{
Config: testAccRedisInstance_update2(name, false),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func TestAccServiceDirectoryNamespace_serviceDirectoryNamespaceUpdateExample(t *
ResourceName: "google_service_directory_namespace.example",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,17 +95,19 @@ func TestAccSpannerInstance_update(t *testing.T) {
Config: testAccSpannerInstance_update(dName1, 1, false),
},
{
ResourceName: "google_spanner_instance.updater",
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_spanner_instance.updater",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
{
Config: testAccSpannerInstance_update(dName2, 2, true),
},
{
ResourceName: "google_spanner_instance.updater",
ImportState: true,
ImportStateVerify: true,
ResourceName: "google_spanner_instance.updater",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func TestAccDataSourceVertexAIIndex_basic(t *testing.T) {
map[string]struct{}{
"metadata.0.contents_delta_uri": {},
"metadata.0.is_complete_overwrite": {},
"labels.%": {},
"terraform_labels.%": {}
},
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestAccVertexAIEndpoint_vertexAiEndpointNetwork(t *testing.T) {
ResourceName: "google_vertex_ai_endpoint.endpoint",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"etag", "location", "region"},
ImportStateVerifyIgnore: []string{"etag", "location", "region", "labels", "terraform_labels"},
},
{
Config: testAccVertexAIEndpoint_vertexAiEndpointNetworkUpdate(context),
Expand All @@ -43,7 +43,7 @@ func TestAccVertexAIEndpoint_vertexAiEndpointNetwork(t *testing.T) {
ResourceName: "google_vertex_ai_endpoint.endpoint",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"etag", "location", "region"},
ImportStateVerifyIgnore: []string{"etag", "location", "region", "labels", "terraform_labels"},
},
},
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func TestAccVertexAIIndex_updated(t *testing.T) {
ResourceName: "google_vertex_ai_index.index",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"etag", "region", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite"},
ImportStateVerifyIgnore: []string{"etag", "region", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite", "labels", "terraform_labels"},
},
{
Config: testAccVertexAIIndex_updated(context),
Expand All @@ -43,7 +43,7 @@ func TestAccVertexAIIndex_updated(t *testing.T) {
ResourceName: "google_vertex_ai_index.index",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"etag", "region", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite"},
ImportStateVerifyIgnore: []string{"etag", "region", "metadata.0.contents_delta_uri", "metadata.0.is_complete_overwrite", "labels", "terraform_labels"},
},
},
})
Expand Down
Loading

0 comments on commit ced30ad

Please sign in to comment.