Skip to content

Commit

Permalink
Fix forces replacement on empty array (#15618)
Browse files Browse the repository at this point in the history
* Fix forces replacement on empty array

* adding tests on dns_config for PR:#15618

* update tests on dns_config for PR:#15618

* update tests on dns_config for PR:#15618

Co-authored-by: Sébastien Caloone <sebastien.caloone@fr.clara.net>
  • Loading branch information
sinc59 and Sébastien Caloone authored Mar 3, 2022
1 parent 1cdd94b commit 55ceaa0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions internal/services/containers/container_group_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1660,14 +1660,14 @@ func flattenContainerGroupDnsConfig(input *containerinstance.DNSConfiguration) [
// We're converting to TypeSet here from an API response that looks like "a b c" (assumes space delimited)
var searchDomains []string
if input.SearchDomains != nil {
searchDomains = strings.Split(*input.SearchDomains, " ")
searchDomains = strings.Fields(*input.SearchDomains)
}
output["search_domains"] = searchDomains

// We're converting to TypeSet here from an API response that looks like "a b c" (assumes space delimited)
var options []string
if input.Options != nil {
options = strings.Split(*input.Options, " ")
options = strings.Fields(*input.Options)
}
output["options"] = options

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1370,9 +1370,7 @@ resource "azurerm_container_group" "test" {
}
dns_config {
nameservers = ["reddog.microsoft.com", "somecompany.somedomain"]
options = ["one:option", "two:option", "red:option", "blue:option"]
search_domains = ["default.svc.cluster.local."]
nameservers = ["reddog.microsoft.com", "somecompany.somedomain"]
}
identity {
Expand Down

0 comments on commit 55ceaa0

Please sign in to comment.