Skip to content

Commit fc9d361

Browse files
committed
Apply new annotations model to more resources
1 parent df9725a commit fc9d361

22 files changed

+75
-52
lines changed

mmv1/products/cloudrunv2/Job.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ properties:
137137
138138
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.
139139
All system labels in v1 now have a corresponding field in v2 Job.
140-
- !ruby/object:Api::Type::KeyValuePairs
140+
- !ruby/object:Api::Type::KeyValueAnnotations
141141
name: "annotations"
142142
description: |-
143143
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.

mmv1/products/gkeonprem/BareMetalAdminCluster.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ properties:
133133
Allows clients to perform consistent read-modify-writes
134134
through optimistic concurrency control.
135135
output: true
136-
- !ruby/object:Api::Type::KeyValuePairs
136+
- !ruby/object:Api::Type::KeyValueAnnotations
137137
name: "annotations"
138138
description: |
139139
Annotations on the Bare Metal Admin Cluster.

mmv1/products/gkeonprem/BareMetalCluster.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ properties:
8585
required: true
8686
description: |
8787
A human readable description of this Bare Metal User Cluster.
88-
- !ruby/object:Api::Type::KeyValuePairs
88+
- !ruby/object:Api::Type::KeyValueAnnotations
8989
name: "annotations"
9090
description: |
9191
Annotations on the Bare Metal User Cluster.
@@ -96,7 +96,6 @@ properties:
9696
Prefix must be a DNS subdomain.
9797
Name must be 63 characters or less, begin and end with alphanumerics,
9898
with dashes (-), underscores (_), dots (.), and alphanumerics between.
99-
default_from_api: true
10099
- !ruby/object:Api::Type::NestedObject
101100
name: "networkConfig"
102101
description: |

mmv1/products/gkeonprem/BareMetalNodePool.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ properties:
7474
name: 'displayName'
7575
description: |
7676
The display name for the Bare Metal Node Pool.
77-
- !ruby/object:Api::Type::KeyValuePairs
77+
- !ruby/object:Api::Type::KeyValueAnnotations
7878
name: 'annotations'
7979
description: |
8080
Annotations on the Bare Metal Node Pool.
@@ -85,7 +85,6 @@ properties:
8585
Prefix must be a DNS subdomain.
8686
Name must be 63 characters or less, begin and end with alphanumerics,
8787
with dashes (-), underscores (_), dots (.), and alphanumerics between.
88-
default_from_api: true
8988
- !ruby/object:Api::Type::NestedObject
9089
name: 'nodePoolConfig'
9190
required: true

mmv1/products/gkeonprem/VmwareCluster.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ properties:
8989
required: true
9090
description: |
9191
The Anthos clusters on the VMware version for your user cluster.
92-
- !ruby/object:Api::Type::KeyValuePairs
92+
- !ruby/object:Api::Type::KeyValueAnnotations
9393
name: 'annotations'
9494
description: |
9595
Annotations on the VMware User Cluster.
@@ -100,7 +100,6 @@ properties:
100100
Prefix must be a DNS subdomain.
101101
Name must be 63 characters or less, begin and end with alphanumerics,
102102
with dashes (-), underscores (_), dots (.), and alphanumerics between.
103-
default_from_api: true
104103
- !ruby/object:Api::Type::NestedObject
105104
name: 'controlPlaneNode'
106105
description: |

mmv1/products/gkeonprem/VmwareNodePool.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ properties:
7171
- !ruby/object:Api::Type::String
7272
name: "displayName"
7373
description: The display name for the node pool.
74-
- !ruby/object:Api::Type::KeyValuePairs
74+
- !ruby/object:Api::Type::KeyValueAnnotations
7575
name: "annotations"
7676
description: |
7777
Annotations on the node Pool.
@@ -82,7 +82,6 @@ properties:
8282
Prefix must be a DNS subdomain.
8383
Name must be 63 characters or less, begin and end with alphanumerics,
8484
with dashes (-), underscores (_), dots (.), and alphanumerics between.
85-
default_from_api: true
8685
- !ruby/object:Api::Type::NestedObject
8786
name: "nodePoolAutoscaling"
8887
description: Node Pool autoscaling config for the node pool.

mmv1/products/secretmanager/Secret.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ properties:
7676
7777
An object containing a list of "key": value pairs. Example:
7878
{ "name": "wrench", "mass": "1.3kg", "count": "3" }.
79-
- !ruby/object:Api::Type::KeyValuePairs
79+
- !ruby/object:Api::Type::KeyValueAnnotations
8080
name: annotations
8181
description: |
8282
Custom metadata about the secret.

mmv1/products/workstations/Workstation.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ properties:
122122
description:
123123
'Client-specified labels that are applied to the resource and that are
124124
also propagated to the underlying Compute Engine resources.'
125-
- !ruby/object:Api::Type::KeyValuePairs
125+
- !ruby/object:Api::Type::KeyValueAnnotations
126126
name: 'annotations'
127127
description: 'Client-specified annotations. This is distinct from labels.'
128128
- !ruby/object:Api::Type::Time

mmv1/products/workstations/WorkstationCluster.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ properties:
118118
Whether this resource is in degraded mode, in which case it may require user action to restore full functionality.
119119
Details can be found in the conditions field.
120120
output: true
121-
- !ruby/object:Api::Type::KeyValuePairs
121+
- !ruby/object:Api::Type::KeyValueAnnotations
122122
name: "annotations"
123123
description: "Client-specified annotations. This is distinct from labels."
124124
- !ruby/object:Api::Type::Fingerprint

mmv1/products/workstations/WorkstationConfig.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ properties:
158158
description:
159159
'Client-specified labels that are applied to the resource and that are
160160
also propagated to the underlying Compute Engine resources.'
161-
- !ruby/object:Api::Type::KeyValuePairs
161+
- !ruby/object:Api::Type::KeyValueAnnotations
162162
name: 'annotations'
163163
description: 'Client-specified annotations. This is distinct from labels.'
164164
- !ruby/object:Api::Type::Fingerprint

mmv1/templates/terraform/examples/gkeonprem_bare_metal_admin_cluster_full.tf.erb

+3-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ resource "google_gkeonprem_bare_metal_admin_cluster" "<%= ctx[:primary_resource_
44
location = "us-west1"
55
description = "test description"
66
bare_metal_version = "1.13.4"
7-
annotations = {}
7+
annotations = {
8+
env = "test"
9+
}
810
network_config {
911
island_mode_cidr {
1012
service_address_cidr_blocks = ["172.26.0.0/16"]

mmv1/templates/terraform/examples/workstation_config_basic.tf.erb

+4
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ resource "google_workstations_workstation_config" "<%= ctx[:primary_resource_id]
3737
idle_timeout = "600s"
3838
running_timeout = "21600s"
3939

40+
annotations = {
41+
label-one = "value-one"
42+
}
43+
4044
host {
4145
gce_instance {
4246
machine_type = "e2-standard-4"

mmv1/third_party/terraform/services/cloudrunv2/resource_cloud_run_v2_job_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobFullUpdate(t *testing.T) {
2626
ResourceName: "google_cloud_run_v2_job.default",
2727
ImportState: true,
2828
ImportStateVerify: true,
29-
ImportStateVerifyIgnore: []string{"location", "launch_stage"},
29+
ImportStateVerifyIgnore: []string{"location", "launch_stage", "annotations"},
3030
},
3131
{
3232
Config: testAccCloudRunV2Job_cloudrunv2JobFullUpdate(context),
@@ -35,7 +35,7 @@ func TestAccCloudRunV2Job_cloudrunv2JobFullUpdate(t *testing.T) {
3535
ResourceName: "google_cloud_run_v2_job.default",
3636
ImportState: true,
3737
ImportStateVerify: true,
38-
ImportStateVerifyIgnore: []string{"location", "launch_stage"},
38+
ImportStateVerifyIgnore: []string{"location", "launch_stage", "annotations"},
3939
},
4040
},
4141
})

mmv1/third_party/terraform/services/gkeonprem/resource_gkeonprem_bare_metal_cluster_test.go.erb

+8
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ func TestAccGkeonpremBareMetalCluster_bareMetalClusterUpdateBasic(t *testing.T)
2525
ResourceName: "google_gkeonprem_bare_metal_cluster.cluster-metallb",
2626
ImportState: true,
2727
ImportStateVerify: true,
28+
ImportStateVerifyIgnore: []string{"annotations"},
2829
},
2930
{
3031
Config: testAccGkeonpremBareMetalCluster_bareMetalClusterUpdateMetalLb(context),
@@ -33,6 +34,7 @@ func TestAccGkeonpremBareMetalCluster_bareMetalClusterUpdateBasic(t *testing.T)
3334
ResourceName: "google_gkeonprem_bare_metal_cluster.cluster-metallb",
3435
ImportState: true,
3536
ImportStateVerify: true,
37+
ImportStateVerifyIgnore: []string{"annotations"},
3638
},
3739
},
3840
})
@@ -105,6 +107,9 @@ func testAccGkeonpremBareMetalCluster_bareMetalClusterUpdateMetalLbStart(context
105107
provider = google-beta
106108
name = "cluster-metallb"
107109
location = "us-west1"
110+
annotations = {
111+
env = "test"
112+
}
108113
admin_cluster_membership = "projects/870316890899/locations/global/memberships/gkeonprem-terraform-test"
109114
bare_metal_version = "1.12.3"
110115
network_config {
@@ -181,6 +186,9 @@ func testAccGkeonpremBareMetalCluster_bareMetalClusterUpdateMetalLb(context map[
181186
provider = google-beta
182187
name = "cluster-metallb"
183188
location = "us-west1"
189+
annotations = {
190+
env = "test-update"
191+
}
184192
admin_cluster_membership = "projects/870316890899/locations/global/memberships/gkeonprem-terraform-test"
185193
bare_metal_version = "1.12.3"
186194
network_config {

mmv1/third_party/terraform/services/gkeonprem/resource_gkeonprem_bare_metal_node_pool_test.go.erb

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func TestAccGkeonpremBareMetalNodePool_bareMetalNodePoolUpdate(t *testing.T) {
2727
ResourceName: "google_gkeonprem_bare_metal_node_pool.nodepool",
2828
ImportState: true,
2929
ImportStateVerify: true,
30+
ImportStateVerifyIgnore: []string{"annotations"},
3031
},
3132
{
3233
Config: testAccGkeonpremBareMetalNodePool_bareMetalNodePoolUpdate(context),
@@ -35,6 +36,7 @@ func TestAccGkeonpremBareMetalNodePool_bareMetalNodePoolUpdate(t *testing.T) {
3536
ResourceName: "google_gkeonprem_bare_metal_node_pool.nodepool",
3637
ImportState: true,
3738
ImportStateVerify: true,
39+
ImportStateVerifyIgnore: []string{"annotations"},
3840
},
3941
},
4042
})
@@ -121,7 +123,9 @@ func testAccGkeonpremBareMetalNodePool_bareMetalNodePoolUpdateStart(context map[
121123
name = "tf-test-nodepool-%{random_suffix}"
122124
location = "us-west1"
123125
bare_metal_cluster = google_gkeonprem_bare_metal_cluster.cluster.name
124-
annotations = {}
126+
annotations = {
127+
env = "test"
128+
}
125129
node_pool_config {
126130
operating_system = "LINUX"
127131
labels = {}
@@ -215,7 +219,9 @@ func testAccGkeonpremBareMetalNodePool_bareMetalNodePoolUpdate(context map[strin
215219
name = "tf-test-nodepool-%{random_suffix}"
216220
location = "us-west1"
217221
bare_metal_cluster = google_gkeonprem_bare_metal_cluster.cluster.name
218-
annotations = {}
222+
annotations = {
223+
env = "test-update"
224+
}
219225
node_pool_config {
220226
operating_system = "LINUX"
221227
labels = {}

mmv1/third_party/terraform/services/gkeonprem/resource_gkeonprem_vmware_cluster_test.go.erb

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func TestAccGkeonpremVmwareCluster_vmwareClusterUpdateBasic(t *testing.T) {
2727
ResourceName: "google_gkeonprem_vmware_cluster.cluster",
2828
ImportState: true,
2929
ImportStateVerify: true,
30+
ImportStateVerifyIgnore: []string{"annotations"},
3031
},
3132
{
3233
Config: testAccGkeonpremVmwareCluster_vmwareClusterUpdateMetalLb(context),
@@ -35,6 +36,7 @@ func TestAccGkeonpremVmwareCluster_vmwareClusterUpdateBasic(t *testing.T) {
3536
ResourceName: "google_gkeonprem_vmware_cluster.cluster",
3637
ImportState: true,
3738
ImportStateVerify: true,
39+
ImportStateVerifyIgnore: []string{"annotations"},
3840
},
3941
},
4042
})
@@ -117,7 +119,9 @@ func testAccGkeonpremVmwareCluster_vmwareClusterUpdateMetalLbStart(context map[s
117119
admin_cluster_membership = "projects/870316890899/locations/global/memberships/gkeonprem-terraform-test"
118120
description = "test cluster"
119121
on_prem_version = "1.13.1-gke.35"
120-
annotations = {}
122+
annotations = {
123+
env = "test"
124+
}
121125
network_config {
122126
service_address_cidr_blocks = ["10.96.0.0/12"]
123127
pod_address_cidr_blocks = ["192.168.0.0/16"]
@@ -165,7 +169,9 @@ func testAccGkeonpremVmwareCluster_vmwareClusterUpdateMetalLb(context map[string
165169
admin_cluster_membership = "projects/870316890899/locations/global/memberships/gkeonprem-terraform-test"
166170
description = "test cluster updated"
167171
on_prem_version = "1.13.1-gke.36"
168-
annotations = {}
172+
annotations = {
173+
env = "test-update"
174+
}
169175
network_config {
170176
service_address_cidr_blocks = ["10.96.0.0/16"]
171177
pod_address_cidr_blocks = ["192.168.0.0/20"]

mmv1/third_party/terraform/services/gkeonprem/resource_gkeonprem_vmware_node_pool_test.go.erb

+8-2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ func TestAccGkeonpremVmwareNodePool_vmwareNodePoolUpdate(t *testing.T) {
2727
ResourceName: "google_gkeonprem_vmware_node_pool.nodepool",
2828
ImportState: true,
2929
ImportStateVerify: true,
30+
ImportStateVerifyIgnore: []string{"annotations"},
3031
},
3132
{
3233
Config: testAccGkeonpremVmwareNodePool_vmwareNodePoolUpdate(context),
@@ -35,6 +36,7 @@ func TestAccGkeonpremVmwareNodePool_vmwareNodePoolUpdate(t *testing.T) {
3536
ResourceName: "google_gkeonprem_vmware_node_pool.nodepool",
3637
ImportState: true,
3738
ImportStateVerify: true,
39+
ImportStateVerifyIgnore: []string{"annotations"},
3840
},
3941
},
4042
})
@@ -92,7 +94,9 @@ func testAccGkeonpremVmwareNodePool_vmwareNodePoolUpdateStart(context map[string
9294
name = "tf-test-nodepool-%{random_suffix}"
9395
location = "us-west1"
9496
vmware_cluster = google_gkeonprem_vmware_cluster.cluster.name
95-
annotations = {}
97+
annotations = {
98+
env = "test"
99+
}
96100
config {
97101
cpus = 4
98102
memory_mb = 8196
@@ -167,7 +171,9 @@ func testAccGkeonpremVmwareNodePool_vmwareNodePoolUpdate(context map[string]inte
167171
name = "tf-test-nodepool-%{random_suffix}"
168172
location = "us-west1"
169173
vmware_cluster = google_gkeonprem_vmware_cluster.cluster.name
170-
annotations = {}
174+
annotations = {
175+
env = "test-update"
176+
}
171177
config {
172178
cpus = 5
173179
memory_mb = 4096

mmv1/third_party/terraform/services/secretmanager/resource_secret_manager_secret_test.go.erb

+3-3
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ func TestAccSecretManagerSecret_annotationsUpdate(t *testing.T) {
8383
ResourceName: "google_secret_manager_secret.secret-with-annotations",
8484
ImportState: true,
8585
ImportStateVerify: true,
86-
ImportStateVerifyIgnore: []string{"ttl"},
86+
ImportStateVerifyIgnore: []string{"ttl", "labels", "terraform_labels", "annotations"},
8787
},
8888
{
8989
Config: testAccSecretManagerSecret_annotationsUpdate(context),
@@ -92,7 +92,7 @@ func TestAccSecretManagerSecret_annotationsUpdate(t *testing.T) {
9292
ResourceName: "google_secret_manager_secret.secret-with-annotations",
9393
ImportState: true,
9494
ImportStateVerify: true,
95-
ImportStateVerifyIgnore: []string{"ttl"},
95+
ImportStateVerifyIgnore: []string{"ttl", "labels", "terraform_labels", "annotations"},
9696
},
9797
{
9898
Config: testAccSecretManagerSecret_annotationsBasic(context),
@@ -101,7 +101,7 @@ func TestAccSecretManagerSecret_annotationsUpdate(t *testing.T) {
101101
ResourceName: "google_secret_manager_secret.secret-with-annotations",
102102
ImportState: true,
103103
ImportStateVerify: true,
104-
ImportStateVerifyIgnore: []string{"ttl"},
104+
ImportStateVerifyIgnore: []string{"ttl", "labels", "terraform_labels", "annotations"},
105105
},
106106
},
107107
})

mmv1/third_party/terraform/services/workstations/resource_workstations_workstation_cluster_test.go.erb

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ func TestAccWorkstationsWorkstationCluster_update(t *testing.T) {
2828
ResourceName: "google_workstations_workstation_cluster.default",
2929
ImportState: true,
3030
ImportStateVerify: true,
31-
ImportStateVerifyIgnore: []string{"etag"},
31+
ImportStateVerifyIgnore: []string{"etag", "annotations"},
3232
},
3333
{
3434
Config: testAccWorkstationsWorkstationCluster_update(context),
@@ -37,7 +37,7 @@ func TestAccWorkstationsWorkstationCluster_update(t *testing.T) {
3737
ResourceName: "google_workstations_workstation_cluster.default",
3838
ImportState: true,
3939
ImportStateVerify: true,
40-
ImportStateVerifyIgnore: []string{"etag"},
40+
ImportStateVerifyIgnore: []string{"etag", "annotations"},
4141
},
4242
},
4343
})
@@ -62,7 +62,7 @@ func TestAccWorkstationsWorkstationCluster_Private_update(t *testing.T) {
6262
ResourceName: "google_workstations_workstation_cluster.default",
6363
ImportState: true,
6464
ImportStateVerify: true,
65-
ImportStateVerifyIgnore: []string{"etag"},
65+
ImportStateVerifyIgnore: []string{"etag", "annotations"},
6666
},
6767
{
6868
Config: testAccWorkstationsWorkstationCluster_private_update(context),
@@ -71,7 +71,7 @@ func TestAccWorkstationsWorkstationCluster_Private_update(t *testing.T) {
7171
ResourceName: "google_workstations_workstation_cluster.default",
7272
ImportState: true,
7373
ImportStateVerify: true,
74-
ImportStateVerifyIgnore: []string{"etag"},
74+
ImportStateVerifyIgnore: []string{"etag", "annotations"},
7575
},
7676
},
7777
})

0 commit comments

Comments
 (0)