Skip to content

Commit

Permalink
Merge branch 'main' into add-reserved-ipv6-resource
Browse files Browse the repository at this point in the history
  • Loading branch information
loosla authored Nov 28, 2024
2 parents 7e2b2d5 + 2be8621 commit 979e174
Show file tree
Hide file tree
Showing 5 changed files with 261 additions and 90 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## 2.44.1

BUG FIXES:

- #1273 - @andrewsomething - opensearch_config: follow PATCH semantics

MISC:

- #1265 - @brianhelba - Fix docs for "digitalocean_database_opensearch_config"
- #1270 - @dduportal - docs(droplet) details `user_data` behavior (resource forces recreate)

## 2.44.0

IMPROVEMENTS:
Expand Down
1 change: 0 additions & 1 deletion digitalocean/app/app_spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,6 @@ func appSpecIngressSchema() *schema.Resource {
"rule": {
Type: schema.TypeList,
Optional: true,
Computed: true,
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"match": {
Expand Down
92 changes: 92 additions & 0 deletions digitalocean/app/resource_app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,55 @@ func TestAccDigitalOceanApp_TimeoutConfig(t *testing.T) {
})
}

func TestAccDigitalOceanApp_makeServiceInternal(t *testing.T) {
var app godo.App
appName := acceptance.RandomTestName()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acceptance.TestAccPreCheck(t) },
Providers: acceptance.TestAccProviders,
CheckDestroy: testAccCheckDigitalOceanAppDestroy,
Steps: []resource.TestStep{
{
Config: fmt.Sprintf(testAccCheckDigitalOceanAppConfig_minimalService, appName),
Check: resource.ComposeTestCheckFunc(
testAccCheckDigitalOceanAppExists("digitalocean_app.foobar", &app),
resource.TestCheckResourceAttr(
"digitalocean_app.foobar", "spec.0.name", appName,
),
resource.TestCheckResourceAttr(
"digitalocean_app.foobar", "spec.0.ingress.0.rule.0.match.0.path.0.prefix", "/",
),
resource.TestCheckResourceAttr(
"digitalocean_app.foobar", "spec.0.service.0.http_port", "8080",
),
),
},
{
Config: fmt.Sprintf(testAccCheckDigitalOceanAppConfig_internalOnlyService, appName),
Check: resource.ComposeTestCheckFunc(
testAccCheckDigitalOceanAppExists("digitalocean_app.foobar", &app),
resource.TestCheckResourceAttr(
"digitalocean_app.foobar", "spec.0.name", appName,
),
resource.TestCheckResourceAttr(
"digitalocean_app.foobar", "spec.0.service.0.http_port", "0",
),
resource.TestCheckResourceAttr(
"digitalocean_app.foobar", "spec.0.service.0.internal_ports.#", "1",
),
resource.TestCheckResourceAttr(
"digitalocean_app.foobar", "spec.0.service.0.internal_ports.0", "8080",
),
resource.TestCheckResourceAttr(
"digitalocean_app.foobar", "spec.0.ingress.0.rule.#", "0",
),
),
},
},
})
}

func testAccCheckDigitalOceanAppDestroy(s *terraform.State) error {
client := acceptance.TestAccProvider.Meta().(*config.CombinedConfig).GodoClient()

Expand Down Expand Up @@ -1577,3 +1626,46 @@ resource "digitalocean_app" "foobar" {
}
}
}`

var testAccCheckDigitalOceanAppConfig_minimalService = `
resource "digitalocean_app" "foobar" {
spec {
name = "%s"
region = "nyc"
service {
name = "go-service"
instance_count = 1
instance_size_slug = "apps-d-1vcpu-0.5gb"
git {
repo_clone_url = "https://github.com/digitalocean/sample-golang.git"
branch = "main"
}
}
}
}`

var testAccCheckDigitalOceanAppConfig_internalOnlyService = `
resource "digitalocean_app" "foobar" {
spec {
name = "%s"
region = "nyc"
service {
name = "go-service"
instance_count = 1
instance_size_slug = "apps-d-1vcpu-0.5gb"
http_port = 0
internal_ports = [8080]
git {
repo_clone_url = "https://github.com/digitalocean/sample-golang.git"
branch = "main"
}
}
ingress {}
}
}`
Loading

0 comments on commit 979e174

Please sign in to comment.