Skip to content

Commit 4a4ba3d

Browse files
Fix pipeline errors after rebuilding fabric_site resource (#104)
1 parent 79b2087 commit 4a4ba3d

7 files changed

+50
-27
lines changed

gen/definitions/fabric_authentication_profile.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ id_query_param: siteNameHierarchy
66
delete_id_query_param: siteNameHierarchy
77
no_update: true
88
skip_minimum_test: true
9+
test_tags: [FABRIC]
910
doc_category: SDA
1011
attributes:
1112
- model_name: siteNameHierarchy
@@ -15,7 +16,7 @@ attributes:
1516
id: true
1617
description: Path of SDA Fabric Site
1718
example: Global/Site1
18-
test_value: 'catalystcenter_fabric_site.test.site_name_hierarchy'
19+
test_value: '"${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"'
1920
- model_name: authenticateTemplateName
2021
tf_name: authentication_template_name
2122
data_path: "0"
@@ -35,7 +36,9 @@ test_prerequisites: |
3536
name = "Area1"
3637
parent_name = "Global"
3738
}
39+
3840
resource "catalystcenter_fabric_site" "test" {
39-
site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"
40-
fabric_type = "FABRIC_SITE"
41-
}
41+
site_id = catalystcenter_area.test.id
42+
authentication_profile_name = "No Authentication"
43+
pub_sub_enabled = false
44+
}

gen/definitions/virtual_network_ip_pool.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ test_prerequisites: |
130130
depends_on = [catalystcenter_ip_pool.test]
131131
}
132132
resource "catalystcenter_fabric_site" "test" {
133-
site_name_hierarchy = "Global/Area1"
134-
fabric_type = "FABRIC_SITE"
135-
depends_on = [catalystcenter_area.test]
133+
site_id = catalystcenter_area.test.id
134+
authentication_profile_name = "No Authentication"
135+
pub_sub_enabled = false
136136
}
137137
resource "catalystcenter_fabric_virtual_network" "test" {
138138
virtual_network_name = "SDA_VN1"

gen/definitions/virtual_network_to_fabric_site.yaml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,31 @@ attributes:
1414
data_source_query: true
1515
description: Virtual Network Name, that is created at Global level
1616
example: SDA_VN1
17-
test_value: catalystcenter_fabric_virtual_network.test.virtual_network_name
17+
test_value: catalystcenter_fabric_virtual_network.test.id
1818
- model_name: siteNameHierarchy
1919
mandatory: true
2020
data_source_query: true
2121
type: String
2222
description: Path of SDA Fabric Site, e.g. `Global/Area1
2323
example: "Global/Area1"
24-
test_value: catalystcenter_fabric_site.test.site_name_hierarchy
24+
test_value: '"${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"'
2525
test_prerequisites: |
2626
resource "catalystcenter_area" "test" {
2727
name = "Area1"
2828
parent_name = "Global"
2929
}
3030
resource "catalystcenter_fabric_site" "test" {
31-
site_name_hierarchy = "Global/Area1"
32-
fabric_type = "FABRIC_SITE"
31+
site_id = catalystcenter_area.test.id
32+
authentication_profile_name = "No Authentication"
33+
pub_sub_enabled = false
3334
3435
depends_on = [catalystcenter_area.test]
3536
}
3637
resource "catalystcenter_fabric_virtual_network" "test" {
3738
virtual_network_name = "SDA_VN1"
3839
is_guest = false
3940
sg_names = ["Employees"]
41+
42+
depends_on = [catalystcenter_fabric_site.test]
4043
}
4144

internal/provider/data_source_catalystcenter_fabric_authentication_profile_test.go

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package provider
1919

2020
// Section below is generated&owned by "gen/generator.go". //template:begin imports
2121
import (
22+
"os"
2223
"testing"
2324

2425
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
@@ -28,6 +29,9 @@ import (
2829

2930
// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSource
3031
func TestAccDataSourceCcFabricAuthenticationProfile(t *testing.T) {
32+
if os.Getenv("FABRIC") == "" {
33+
t.Skip("skipping test, set environment variable FABRIC")
34+
}
3135
var checks []resource.TestCheckFunc
3236
checks = append(checks, resource.TestCheckResourceAttr("data.catalystcenter_fabric_authentication_profile.test", "authentication_template_name", "No Authentication"))
3337
resource.Test(t, resource.TestCase{
@@ -50,18 +54,21 @@ resource "catalystcenter_area" "test" {
5054
name = "Area1"
5155
parent_name = "Global"
5256
}
57+
5358
resource "catalystcenter_fabric_site" "test" {
54-
site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"
55-
fabric_type = "FABRIC_SITE"
59+
site_id = catalystcenter_area.test.id
60+
authentication_profile_name = "No Authentication"
61+
pub_sub_enabled = false
5662
}
63+
5764
`
5865

5966
// End of section. //template:end testPrerequisites
6067

6168
// Section below is generated&owned by "gen/generator.go". //template:begin testAccDataSourceConfig
6269
func testAccDataSourceCcFabricAuthenticationProfileConfig() string {
6370
config := `resource "catalystcenter_fabric_authentication_profile" "test" {` + "\n"
64-
config += ` site_name_hierarchy = catalystcenter_fabric_site.test.site_name_hierarchy` + "\n"
71+
config += ` site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"` + "\n"
6572
config += ` authentication_template_name = "No Authentication"` + "\n"
6673
config += `}` + "\n"
6774

internal/provider/resource_catalystcenter_fabric_authentication_profile_test.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package provider
1919

2020
// Section below is generated&owned by "gen/generator.go". //template:begin imports
2121
import (
22+
"os"
2223
"testing"
2324

2425
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
@@ -28,6 +29,9 @@ import (
2829

2930
// Section below is generated&owned by "gen/generator.go". //template:begin testAcc
3031
func TestAccCcFabricAuthenticationProfile(t *testing.T) {
32+
if os.Getenv("FABRIC") == "" {
33+
t.Skip("skipping test, set environment variable FABRIC")
34+
}
3135
var checks []resource.TestCheckFunc
3236
checks = append(checks, resource.TestCheckResourceAttr("catalystcenter_fabric_authentication_profile.test", "authentication_template_name", "No Authentication"))
3337

@@ -56,18 +60,21 @@ resource "catalystcenter_area" "test" {
5660
name = "Area1"
5761
parent_name = "Global"
5862
}
63+
5964
resource "catalystcenter_fabric_site" "test" {
60-
site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"
61-
fabric_type = "FABRIC_SITE"
65+
site_id = catalystcenter_area.test.id
66+
authentication_profile_name = "No Authentication"
67+
pub_sub_enabled = false
6268
}
69+
6370
`
6471

6572
// End of section. //template:end testPrerequisites
6673

6774
// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimal
6875
func testAccCcFabricAuthenticationProfileConfig_minimum() string {
6976
config := `resource "catalystcenter_fabric_authentication_profile" "test" {` + "\n"
70-
config += ` site_name_hierarchy = catalystcenter_fabric_site.test.site_name_hierarchy` + "\n"
77+
config += ` site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"` + "\n"
7178
config += ` authentication_template_name = "No Authentication"` + "\n"
7279
config += `}` + "\n"
7380
return config
@@ -78,7 +85,7 @@ func testAccCcFabricAuthenticationProfileConfig_minimum() string {
7885
// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
7986
func testAccCcFabricAuthenticationProfileConfig_all() string {
8087
config := `resource "catalystcenter_fabric_authentication_profile" "test" {` + "\n"
81-
config += ` site_name_hierarchy = catalystcenter_fabric_site.test.site_name_hierarchy` + "\n"
88+
config += ` site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"` + "\n"
8289
config += ` authentication_template_name = "No Authentication"` + "\n"
8390
config += `}` + "\n"
8491
return config

internal/provider/resource_catalystcenter_virtual_network_ip_pool_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,9 @@ resource "catalystcenter_ip_pool_reservation" "test" {
8080
depends_on = [catalystcenter_ip_pool.test]
8181
}
8282
resource "catalystcenter_fabric_site" "test" {
83-
site_name_hierarchy = "Global/Area1"
84-
fabric_type = "FABRIC_SITE"
85-
depends_on = [catalystcenter_area.test]
83+
site_id = catalystcenter_area.test.id
84+
authentication_profile_name = "No Authentication"
85+
pub_sub_enabled = false
8686
}
8787
resource "catalystcenter_fabric_virtual_network" "test" {
8888
virtual_network_name = "SDA_VN1"

internal/provider/resource_catalystcenter_virtual_network_to_fabric_site_test.go

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,18 @@ resource "catalystcenter_area" "test" {
5252
parent_name = "Global"
5353
}
5454
resource "catalystcenter_fabric_site" "test" {
55-
site_name_hierarchy = "Global/Area1"
56-
fabric_type = "FABRIC_SITE"
55+
site_id = catalystcenter_area.test.id
56+
authentication_profile_name = "No Authentication"
57+
pub_sub_enabled = false
5758
5859
depends_on = [catalystcenter_area.test]
5960
}
6061
resource "catalystcenter_fabric_virtual_network" "test" {
6162
virtual_network_name = "SDA_VN1"
6263
is_guest = false
6364
sg_names = ["Employees"]
65+
66+
depends_on = [catalystcenter_fabric_site.test]
6467
}
6568
6669
`
@@ -70,8 +73,8 @@ resource "catalystcenter_fabric_virtual_network" "test" {
7073
// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigMinimal
7174
func testAccCcVirtualNetworkToFabricSiteConfig_minimum() string {
7275
config := `resource "catalystcenter_virtual_network_to_fabric_site" "test" {` + "\n"
73-
config += ` virtual_network_name = catalystcenter_fabric_virtual_network.test.virtual_network_name` + "\n"
74-
config += ` site_name_hierarchy = catalystcenter_fabric_site.test.site_name_hierarchy` + "\n"
76+
config += ` virtual_network_name = catalystcenter_fabric_virtual_network.test.id` + "\n"
77+
config += ` site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"` + "\n"
7578
config += `}` + "\n"
7679
return config
7780
}
@@ -81,8 +84,8 @@ func testAccCcVirtualNetworkToFabricSiteConfig_minimum() string {
8184
// Section below is generated&owned by "gen/generator.go". //template:begin testAccConfigAll
8285
func testAccCcVirtualNetworkToFabricSiteConfig_all() string {
8386
config := `resource "catalystcenter_virtual_network_to_fabric_site" "test" {` + "\n"
84-
config += ` virtual_network_name = catalystcenter_fabric_virtual_network.test.virtual_network_name` + "\n"
85-
config += ` site_name_hierarchy = catalystcenter_fabric_site.test.site_name_hierarchy` + "\n"
87+
config += ` virtual_network_name = catalystcenter_fabric_virtual_network.test.id` + "\n"
88+
config += ` site_name_hierarchy = "${catalystcenter_area.test.parent_name}/${catalystcenter_area.test.name}"` + "\n"
8689
config += `}` + "\n"
8790
return config
8891
}

0 commit comments

Comments
 (0)