Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: cleanup after location migration #37

Merged
merged 1 commit into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docs/data-sources/core_location.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,4 @@ Read-Only:

Optional:

- `region` (String) Region is the location region.
- `sites` (List of String) Sites are the site names that makes up the location.
- `type` (String) Type is the type of the datacenter, e.g. cloud or bare metal.
2 changes: 0 additions & 2 deletions docs/data-sources/core_location_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,4 @@ Read-Only:

Optional:

- `region` (String) Region is the location region.
- `sites` (List of String) Sites are the site names that makes up the location.
- `type` (String) Type is the type of the datacenter, e.g. cloud or bare metal.
1 change: 0 additions & 1 deletion docs/data-sources/core_region.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Optional:
Required:

- `name` (String) Name is the name of the region type.
- `sites` (List of String) Sites defines the sites for a type.

Optional:

Expand Down
1 change: 0 additions & 1 deletion docs/data-sources/core_region_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ Optional:
Required:

- `name` (String) Name is the name of the region type.
- `sites` (List of String) Sites defines the sites for a type.

Optional:

Expand Down
1 change: 0 additions & 1 deletion docs/resources/core_region.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ Optional:
Required:

- `name` (String) Name is the name of the region type.
- `sites` (List of String) Sites defines the sites for a type.

Optional:

Expand Down
1 change: 0 additions & 1 deletion docs/resources/core_region_v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ Optional:
Required:

- `name` (String) Name is the name of the region type.
- `sites` (List of String) Sites defines the sites for a type.

Optional:

Expand Down
14 changes: 7 additions & 7 deletions ec/core/data_source_core_region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ func TestDataSourceRegions(t *testing.T) {
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.description", "My Region"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.#", "1"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.name", "my-type"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.sites.#", "2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.sites.0", "test-site-1"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.sites.1", "test-site-2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.locations.#", "2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.locations.0", "test-loc-1"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.locations.1", "test-loc-2"),
),
},
{
Expand All @@ -41,9 +41,9 @@ func TestDataSourceRegions(t *testing.T) {
resource.TestCheckResourceAttr("data.ec_core_region.test", "spec.0.description", "My Region"),
resource.TestCheckResourceAttr("data.ec_core_region.test", "spec.0.types.#", "1"),
resource.TestCheckResourceAttr("data.ec_core_region.test", "spec.0.types.0.name", "my-type"),
resource.TestCheckResourceAttr("data.ec_core_region.test", "spec.0.types.0.sites.#", "2"),
resource.TestCheckResourceAttr("data.ec_core_region.test", "spec.0.types.0.sites.0", "test-site-1"),
resource.TestCheckResourceAttr("data.ec_core_region.test", "spec.0.types.0.sites.1", "test-site-2"),
resource.TestCheckResourceAttr("data.ec_core_region.test", "spec.0.types.0.locations.#", "2"),
resource.TestCheckResourceAttr("data.ec_core_region.test", "spec.0.types.0.locations.0", "test-loc-1"),
resource.TestCheckResourceAttr("data.ec_core_region.test", "spec.0.types.0.locations.1", "test-loc-2"),
),
},
},
Expand All @@ -60,7 +60,7 @@ func testDataSourceRegionsConfigBasic(name, env string) string {
description = "My Region"
types {
name = "my-type"
sites = ["test-site-1", "test-site-2"]
locations = ["test-loc-1", "test-loc-2"]
}
}
}
Expand Down
16 changes: 8 additions & 8 deletions ec/core/resource_core_region_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ func TestResourceRegions(t *testing.T) {
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.description", "My Region"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.#", "1"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.name", "my-type"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.sites.#", "2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.sites.0", "test-site-1"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.sites.1", "test-site-2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.locations.#", "2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.locations.0", "test-loc-1"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.locations.1", "test-loc-2"),
),
},
{
Expand All @@ -46,9 +46,9 @@ func TestResourceRegions(t *testing.T) {
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.description", "My Region"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.#", "1"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.name", "my-type"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.sites.#", "2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.sites.0", "test-site-1"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.sites.1", "test-site-2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.locations.#", "2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.locations.0", "test-loc-1"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.locations.1", "test-loc-2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.template.0.env.#", "2"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.template.0.env.0.name", "foo"),
resource.TestCheckResourceAttr("ec_core_region.test", "spec.0.types.0.template.0.env.0.value", "bar"),
Expand All @@ -75,7 +75,7 @@ func testResourceRegionsConfigBasic(env, name string) string {
description = "My Region"
types {
name = "my-type"
sites = ["test-site-1", "test-site-2"]
locations = ["test-loc-1", "test-loc-2"]
}
}
}`, name, env)
Expand All @@ -91,7 +91,7 @@ func testResourceRegionsConfigBasicWithEnv(env, name string) string {
description = "My Region"
types {
name = "my-type"
sites = ["test-site-1", "test-site-2"]
locations = ["test-loc-1", "test-loc-2"]
template {
env {
name = "foo"
Expand Down
10 changes: 0 additions & 10 deletions ec/core/schema_location.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions ec/core/schema_region.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require (
github.com/nitrado/tfconv v1.2.1
github.com/stretchr/testify v1.9.0
gitlab.com/nitrado/b2b/ec/apicore v1.3.0
gitlab.com/nitrado/b2b/ec/core v0.15.0
gitlab.com/nitrado/b2b/ec/core v0.16.1
golang.org/x/oauth2 v0.23.0
k8s.io/apimachinery v0.30.3
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940 h1:4r45xpDWB6
github.com/zclconf/go-cty-debug v0.0.0-20240509010212-0d6042c53940/go.mod h1:CmBdvvj3nqzfzJ6nTCIwDTPZ56aVGvDrmztiO5g3qrM=
gitlab.com/nitrado/b2b/ec/apicore v1.3.0 h1:WPBMnOnp9bSv/Vi/nRW9g5jehvPMhV4mD4LhBJqX++Q=
gitlab.com/nitrado/b2b/ec/apicore v1.3.0/go.mod h1:Jm1WG3CcNmYbZAoIrof/W4I1THJtmtilRIFD/tc3MNs=
gitlab.com/nitrado/b2b/ec/core v0.15.0 h1:TqL0tW9onanpjNJ2ChjGmwBjN1clMyo3VxMI/YVc8jE=
gitlab.com/nitrado/b2b/ec/core v0.15.0/go.mod h1:AqkIlKp++Ha5zemqHNryUM1Ck81pX2WLUEQ4O2kmTg0=
gitlab.com/nitrado/b2b/ec/core v0.16.1 h1:T1QOJHK3/r4v9gboO4uIlafQeDImrIID/0SqNI4OXhA=
gitlab.com/nitrado/b2b/ec/core v0.16.1/go.mod h1:AqkIlKp++Ha5zemqHNryUM1Ck81pX2WLUEQ4O2kmTg0=
go.abhg.dev/goldmark/frontmatter v0.2.0 h1:P8kPG0YkL12+aYk2yU3xHv4tcXzeVnN+gU0tJ5JnxRw=
go.abhg.dev/goldmark/frontmatter v0.2.0/go.mod h1:XqrEkZuM57djk7zrlRUB02x8I5J0px76YjkOzhB4YlU=
go.opentelemetry.io/otel v1.30.0 h1:F2t8sK4qf1fAmY9ua4ohFS/K+FUuOPemHUIXHtktrts=
Expand Down
Loading