From 965308a8279503d9b57f7e1dda9fcebcd57b794e Mon Sep 17 00:00:00 2001 From: jackofallops Date: Mon, 29 Jul 2024 13:41:42 +0200 Subject: [PATCH 1/2] make docker_image_name handling consistent --- internal/services/appservice/helpers/web_app_slot_schema.go | 4 ++-- .../services/appservice/helpers/windows_web_app_schema.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/services/appservice/helpers/web_app_slot_schema.go b/internal/services/appservice/helpers/web_app_slot_schema.go index 56e7bc291fc0..6339fcf2205c 100644 --- a/internal/services/appservice/helpers/web_app_slot_schema.go +++ b/internal/services/appservice/helpers/web_app_slot_schema.go @@ -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} } @@ -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} } diff --git a/internal/services/appservice/helpers/windows_web_app_schema.go b/internal/services/appservice/helpers/windows_web_app_schema.go index 6e640892a1ca..24ee3f5acf1f 100644 --- a/internal/services/appservice/helpers/windows_web_app_schema.go +++ b/internal/services/appservice/helpers/windows_web_app_schema.go @@ -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} } From 40c93cc59f742e02e98f6a290f633413405bdae8 Mon Sep 17 00:00:00 2001 From: jackofallops Date: Mon, 29 Jul 2024 13:44:31 +0200 Subject: [PATCH 2/2] fixup tests --- ...service_environment_v3_data_source_test.go | 1 - ...pp_service_environment_v3_resource_test.go | 1 - ...linux_function_app_resource_authv2_test.go | 11 ++++---- .../linux_function_app_resource_test.go | 2 ++ .../linux_web_app_slot_resource_test.go | 27 ++++++++++--------- ...ndows_function_app_resource_authv2_test.go | 11 ++++---- 6 files changed, 28 insertions(+), 25 deletions(-) diff --git a/internal/services/appservice/app_service_environment_v3_data_source_test.go b/internal/services/appservice/app_service_environment_v3_data_source_test.go index 12252ba5241c..34a6d9528ef0 100644 --- a/internal/services/appservice/app_service_environment_v3_data_source_test.go +++ b/internal/services/appservice/app_service_environment_v3_data_source_test.go @@ -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"), ), diff --git a/internal/services/appservice/app_service_environment_v3_resource_test.go b/internal/services/appservice/app_service_environment_v3_resource_test.go index a63e92cf38c3..ea53692ac57c 100644 --- a/internal/services/appservice/app_service_environment_v3_resource_test.go +++ b/internal/services/appservice/app_service_environment_v3_resource_test.go @@ -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"), ), diff --git a/internal/services/appservice/linux_function_app_resource_authv2_test.go b/internal/services/appservice/linux_function_app_resource_authv2_test.go index 37c8f47b9251..5b358d0f6997 100644 --- a/internal/services/appservice/linux_function_app_resource_authv2_test.go +++ b/internal/services/appservice/linux_function_app_resource_authv2_test.go @@ -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" diff --git a/internal/services/appservice/linux_function_app_resource_test.go b/internal/services/appservice/linux_function_app_resource_test.go index a6d5c1f22170..25bd8f39bd5d 100644 --- a/internal/services/appservice/linux_function_app_resource_test.go +++ b/internal/services/appservice/linux_function_app_resource_test.go @@ -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" } diff --git a/internal/services/appservice/linux_web_app_slot_resource_test.go b/internal/services/appservice/linux_web_app_slot_resource_test.go index dc19153ea96c..14f646e659a0 100644 --- a/internal/services/appservice/linux_web_app_slot_resource_test.go +++ b/internal/services/appservice/linux_web_app_slot_resource_test.go @@ -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", diff --git a/internal/services/appservice/windows_function_app_resource_authv2_test.go b/internal/services/appservice/windows_function_app_resource_authv2_test.go index b928e501e16f..cfada5801e78 100644 --- a/internal/services/appservice/windows_function_app_resource_authv2_test.go +++ b/internal/services/appservice/windows_function_app_resource_authv2_test.go @@ -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"