You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/content/best-practices/_index.md
+6-5
Original file line number
Diff line number
Diff line change
@@ -67,8 +67,8 @@ When adding a new `labels` field, please make the changes below to support the n
67
67
1. Use the type `KeyValueLabels` for the standard resource `labels` field. The standard resource `labels` field could be the top level `labels` field or the nested `labels` field inside the top level `metadata` field. Don't add `default_from_api: true` to this field or don't use this type for other `labels` fields in the resource. `KeyValueLabels` will add all of changes required for the new model automatically.
68
68
69
69
```yaml
70
-
- !ruby/object:Api::Type::KeyValueLabels
71
-
name: 'labels'
70
+
- name: 'labels'
71
+
type: KeyValueLabels
72
72
description: |
73
73
The labels associated with this dataset. You can use these to
74
74
organize and group your datasets.
@@ -155,9 +155,10 @@ When adding a new `annotations` field, please make the changes below below to su
155
155
1. Use the type `KeyValueAnnotations` for the standard resource `annotations` field. The standard resource `annotations` field could be the top level `annotations` field or the nested `annotations` field inside the top level `metadata` field. Don't add `default_from_api: true` to this field or don't use this type for other `annotations` fields in the resource. `KeyValueAnnotations` will add all of changes required for the new model automatically.
156
156
157
157
```yaml
158
-
- !ruby/object:Api::Type::KeyValueAnnotations
159
-
name: 'annotations'
160
-
description: 'Client-specified annotations. This is distinct from labels.'
158
+
- name: 'annotations'
159
+
type: KeyValueAnnotations
160
+
description: |
161
+
Client-specified annotations. This is distinct from labels.
161
162
```
162
163
2. In the handwritten acceptance tests, add `annotations` to `ImportStateVerifyIgnore` if `annotations` field is in the configuration.
Copy file name to clipboardExpand all lines: docs/content/develop/add-handwritten-datasource.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ a new datasource there are 5 steps to doing so.
24
24
1. Add Schema and Read operation implementation
25
25
- If there is `labels` field with type `KeyValueLabels` in the corresponding resource, in the datasource Read operation implementation, after the resource read method, call the function `tpgresource.SetDataSourceLabels(d)` to make `labels` and `terraform_labels` have all of the labels on the resource.
26
26
- If there is `annotations` field with type `KeyValueAnnotations` in the corresponding resource, in the datasource Read operation implementation, after the resource read method, call the function `tpgresource.SetDataSourceAnnotations(d)` to make `annotations` have all of the annotations on the resource.
27
-
1. Register the datasource to `handwrittenDatasources` in [`magic-modules/mmv1/third_party/terraform/provider/provider_mmv1_resources.go.erb`](https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/provider/provider_mmv1_resources.go.erb)
27
+
1. Register the datasource to `handwrittenDatasources` in [`magic-modules/mmv1/third_party/terraform/provider/provider_mmv1_resources.go.tmpl`](https://github.com/GoogleCloudPlatform/magic-modules/blob/main/mmv1/third_party/terraform/provider/provider_mmv1_resources.go.tmpl)
28
28
1. Implement a test which will create and resources and read the corresponding
0 commit comments