Skip to content

Commit cf929e9

Browse files
committed
Revert "add dns keys datasource (#7186) (#5179)"
This reverts commit 0680a77.
1 parent 5be88f0 commit cf929e9

File tree

6 files changed

+168
-455
lines changed

6 files changed

+168
-455
lines changed

.changelog/7186.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

google-beta/data_source_dns_key_test.go

Lines changed: 8 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -11,41 +11,21 @@ import (
1111
func TestAccDataSourceDNSKeys_basic(t *testing.T) {
1212
t.Parallel()
1313

14-
dnsZoneName := fmt.Sprintf("tf-dnskey-test-%s", randString(t, 10))
15-
16-
var kskDigest1, kskDigest2, zskPubKey1, zskPubKey2, kskAlg1, kskAlg2 string
14+
dnsZoneName := fmt.Sprintf("data-dnskey-test-%s", randString(t, 10))
1715

1816
vcrTest(t, resource.TestCase{
1917
PreCheck: func() { testAccPreCheck(t) },
20-
CheckDestroy: testAccCheckDNSManagedZoneDestroyProducerFramework(t),
18+
Providers: testAccProviders,
19+
CheckDestroy: testAccCheckDNSManagedZoneDestroyProducer(t),
2120
Steps: []resource.TestStep{
2221
{
23-
ExternalProviders: providerVersion450(),
24-
Config: testAccDataSourceDNSKeysConfig(dnsZoneName, "on"),
22+
Config: testAccDataSourceDNSKeysConfig(dnsZoneName, "on"),
2523
Check: resource.ComposeTestCheckFunc(
2624
testAccDataSourceDNSKeysDSRecordCheck("data.google_dns_keys.foo_dns_key"),
2725
resource.TestCheckResourceAttr("data.google_dns_keys.foo_dns_key", "key_signing_keys.#", "1"),
2826
resource.TestCheckResourceAttr("data.google_dns_keys.foo_dns_key", "zone_signing_keys.#", "1"),
2927
resource.TestCheckResourceAttr("data.google_dns_keys.foo_dns_key_id", "key_signing_keys.#", "1"),
3028
resource.TestCheckResourceAttr("data.google_dns_keys.foo_dns_key_id", "zone_signing_keys.#", "1"),
31-
testExtractResourceAttr("data.google_dns_keys.foo_dns_key", "key_signing_keys.0.digests.0.digest", &kskDigest1),
32-
testExtractResourceAttr("data.google_dns_keys.foo_dns_key_id", "zone_signing_keys.0.public_key", &zskPubKey1),
33-
testExtractResourceAttr("data.google_dns_keys.foo_dns_key_id", "key_signing_keys.0.algorithm", &kskAlg1),
34-
),
35-
},
36-
{
37-
ProtoV5ProviderFactories: protoV5ProviderFactories(t),
38-
Config: testAccDataSourceDNSKeysConfig(dnsZoneName, "on"),
39-
Check: resource.ComposeTestCheckFunc(
40-
testAccDataSourceDNSKeysDSRecordCheck("data.google_dns_keys.foo_dns_key"),
41-
resource.TestCheckResourceAttr("data.google_dns_keys.foo_dns_key", "key_signing_keys.#", "1"),
42-
resource.TestCheckResourceAttr("data.google_dns_keys.foo_dns_key", "zone_signing_keys.#", "1"),
43-
testExtractResourceAttr("data.google_dns_keys.foo_dns_key", "key_signing_keys.0.digests.0.digest", &kskDigest2),
44-
testExtractResourceAttr("data.google_dns_keys.foo_dns_key_id", "zone_signing_keys.0.public_key", &zskPubKey2),
45-
testExtractResourceAttr("data.google_dns_keys.foo_dns_key_id", "key_signing_keys.0.algorithm", &kskAlg2),
46-
testCheckAttributeValuesEqual(&kskDigest1, &kskDigest2),
47-
testCheckAttributeValuesEqual(&zskPubKey1, &zskPubKey2),
48-
testCheckAttributeValuesEqual(&kskAlg1, &kskAlg2),
4929
),
5030
},
5131
},
@@ -55,23 +35,15 @@ func TestAccDataSourceDNSKeys_basic(t *testing.T) {
5535
func TestAccDataSourceDNSKeys_noDnsSec(t *testing.T) {
5636
t.Parallel()
5737

58-
dnsZoneName := fmt.Sprintf("tf-dnskey-test-%s", randString(t, 10))
38+
dnsZoneName := fmt.Sprintf("data-dnskey-test-%s", randString(t, 10))
5939

6040
vcrTest(t, resource.TestCase{
6141
PreCheck: func() { testAccPreCheck(t) },
62-
CheckDestroy: testAccCheckDNSManagedZoneDestroyProducerFramework(t),
42+
Providers: testAccProviders,
43+
CheckDestroy: testAccCheckDNSManagedZoneDestroyProducer(t),
6344
Steps: []resource.TestStep{
6445
{
65-
ExternalProviders: providerVersion450(),
66-
Config: testAccDataSourceDNSKeysConfig(dnsZoneName, "off"),
67-
Check: resource.ComposeTestCheckFunc(
68-
resource.TestCheckResourceAttr("data.google_dns_keys.foo_dns_key", "key_signing_keys.#", "0"),
69-
resource.TestCheckResourceAttr("data.google_dns_keys.foo_dns_key", "zone_signing_keys.#", "0"),
70-
),
71-
},
72-
{
73-
ProtoV5ProviderFactories: protoV5ProviderFactories(t),
74-
Config: testAccDataSourceDNSKeysConfig(dnsZoneName, "off"),
46+
Config: testAccDataSourceDNSKeysConfig(dnsZoneName, "off"),
7547
Check: resource.ComposeTestCheckFunc(
7648
resource.TestCheckResourceAttr("data.google_dns_keys.foo_dns_key", "key_signing_keys.#", "0"),
7749
resource.TestCheckResourceAttr("data.google_dns_keys.foo_dns_key", "zone_signing_keys.#", "0"),

0 commit comments

Comments
 (0)