Skip to content

Commit 6091161

Browse files
authored
eventarc: add labels field in channel resource (#15463)
1 parent 04924bb commit 6091161

File tree

2 files changed

+16
-6
lines changed

2 files changed

+16
-6
lines changed

mmv1/products/eventarc/Channel.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ properties:
7070
diff_suppress_func: tpgresource.CompareSelfLinkOrResourceName
7171
custom_expand: templates/terraform/custom_expand/eventarc_channel_name.go.tmpl
7272
custom_flatten: templates/terraform/custom_flatten/eventarc_channel_name.go.tmpl
73+
- name: 'labels'
74+
type: KeyValueLabels
75+
description: 'User-defined labels for the channel.'
7376
- name: uid
7477
type: String
7578
description: Server assigned unique identifier for the channel. The value is a UUID4 string and guaranteed to remain unchanged until the resource is deleted.

mmv1/third_party/terraform/services/eventarc/resource_eventarc_channel_test.go

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,19 @@ func TestAccEventarcChannel_cryptoKeyUpdate(t *testing.T) {
3737
Config: testAccEventarcChannel_setCryptoKey(context),
3838
},
3939
{
40-
ResourceName: "google_eventarc_channel.primary",
41-
ImportState: true,
42-
ImportStateVerify: true,
40+
ResourceName: "google_eventarc_channel.primary",
41+
ImportState: true,
42+
ImportStateVerify: true,
43+
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
4344
},
4445
{
4546
Config: testAccEventarcChannel_cryptoKeyUpdate(context),
4647
},
4748
{
48-
ResourceName: "google_eventarc_channel.primary",
49-
ImportState: true,
50-
ImportStateVerify: true,
49+
ResourceName: "google_eventarc_channel.primary",
50+
ImportState: true,
51+
ImportStateVerify: true,
52+
ImportStateVerifyIgnore: []string{"labels", "terraform_labels"},
5153
},
5254
},
5355
})
@@ -60,6 +62,10 @@ resource "google_eventarc_channel" "primary" {
6062
name = "tf-test-name%{random_suffix}"
6163
crypto_key_name = "%{key1}"
6264
third_party_provider = "projects/%{project_name}/locations/%{region}/providers/datadog"
65+
66+
labels = {
67+
"foo" = "bar"
68+
}
6369
}
6470
`, context)
6571
}
@@ -71,6 +77,7 @@ resource "google_eventarc_channel" "primary" {
7177
name = "tf-test-name%{random_suffix}"
7278
crypto_key_name = "%{key2}"
7379
third_party_provider = "projects/%{project_name}/locations/%{region}/providers/datadog"
80+
7481
}
7582
`, context)
7683
}

0 commit comments

Comments
 (0)