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

appservice - fix tests for 4.0 and make docker_image_name handling consistent for 4.0 #26849

Merged
merged 2 commits into from
Jul 29, 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
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ func TestAccAppServiceEnvironmentV3DataSource_basic(t *testing.T) {
check.That(data.ResourceName).Key("dns_suffix").HasValue(fmt.Sprintf("acctest-ase-%d.appserviceenvironment.net", data.RandomInteger)),
check.That(data.ResourceName).Key("ip_ssl_address_count").HasValue("0"),
check.That(data.ResourceName).Key("inbound_network_dependencies.#").HasValue("3"),
check.That(data.ResourceName).Key("linux_outbound_ip_addresses.#").HasValue("2"),
check.That(data.ResourceName).Key("location").HasValue(data.Locations.Primary),
check.That(data.ResourceName).Key("windows_outbound_ip_addresses.#").HasValue("2"),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ func TestAccAppServiceEnvironmentV3_complete(t *testing.T) {
check.That(data.ResourceName).Key("cluster_setting.#").HasValue("3"),
check.That(data.ResourceName).Key("dns_suffix").HasValue(fmt.Sprintf("acctest-ase-%d.appserviceenvironment.net", data.RandomInteger)),
check.That(data.ResourceName).Key("inbound_network_dependencies.#").HasValue("3"),
check.That(data.ResourceName).Key("linux_outbound_ip_addresses.#").HasValue("2"),
check.That(data.ResourceName).Key("location").HasValue(data.Locations.Primary),
check.That(data.ResourceName).Key("windows_outbound_ip_addresses.#").HasValue("2"),
),
Expand Down
4 changes: 2 additions & 2 deletions internal/services/appservice/helpers/web_app_slot_schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ func (s *SiteConfigLinuxWebAppSlot) DecodeDockerAppStack(input map[string]string

registryHost := trimURLScheme(applicationStack.DockerRegistryUrl)
dockerString := strings.TrimPrefix(s.LinuxFxVersion, "DOCKER|")
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost)
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost+"/")

s.ApplicationStack = []ApplicationStackLinux{applicationStack}
}
Expand Down Expand Up @@ -1471,7 +1471,7 @@ func (s *SiteConfigWindowsWebAppSlot) DecodeDockerAppStack(input map[string]stri

registryHost := trimURLScheme(applicationStack.DockerRegistryUrl)
dockerString := strings.TrimPrefix(s.WindowsFxVersion, "DOCKER|")
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost)
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost+"/")

s.ApplicationStack = []ApplicationStackWindows{applicationStack}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,7 @@ func (s *SiteConfigWindows) DecodeDockerAppStack(input map[string]string) {

registryHost := trimURLScheme(applicationStack.DockerRegistryUrl)
dockerString := strings.TrimPrefix(s.WindowsFxVersion, "DOCKER|")
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost)
applicationStack.DockerImageName = strings.TrimPrefix(dockerString, registryHost+"/")

s.ApplicationStack = []ApplicationStackWindows{applicationStack}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -976,11 +976,12 @@ resource "azurerm_linux_function_app" "test" {
}
}

use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health-check"
worker_count = 3
use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health-check"
health_check_eviction_time_in_min = 5
worker_count = 3

minimum_tls_version = "1.1"
scm_minimum_tls_version = "1.1"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3082,6 +3082,8 @@ resource "azurerm_linux_function_app" "test" {
ftps_state = "FtpsOnly"
health_check_path = "/health-check"

health_check_eviction_time_in_min = 7

application_stack {
python_version = "3.9"
}
Expand Down
27 changes: 14 additions & 13 deletions internal/services/appservice/linux_web_app_slot_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1870,19 +1870,20 @@ resource "azurerm_linux_web_app_slot" "test" {
"third.aspx",
"hostingstart.html",
]
http2_enabled = true
scm_use_main_ip_restriction = true
local_mysql_enabled = true
managed_pipeline_mode = "Integrated"
remote_debugging_enabled = true
remote_debugging_version = "VS2022"
use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health"
worker_count = 1
minimum_tls_version = "1.1"
scm_minimum_tls_version = "1.1"
http2_enabled = true
scm_use_main_ip_restriction = true
local_mysql_enabled = true
managed_pipeline_mode = "Integrated"
remote_debugging_enabled = true
remote_debugging_version = "VS2022"
use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health"
health_check_eviction_time_in_min = 7
worker_count = 1
minimum_tls_version = "1.1"
scm_minimum_tls_version = "1.1"
cors {
allowed_origins = [
"http://www.contoso.com",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -919,11 +919,12 @@ resource "azurerm_windows_function_app" "test" {
}
}

use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health-check"
worker_count = 3
use_32_bit_worker = true
websockets_enabled = true
ftps_state = "FtpsOnly"
health_check_path = "/health-check"
health_check_eviction_time_in_min = 7
worker_count = 3

minimum_tls_version = "1.1"
scm_minimum_tls_version = "1.1"
Expand Down
Loading