Skip to content

Commit

Permalink
fix(lb): add missing health_check_delay (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sh4d1 authored and jerome-quere committed Dec 4, 2019
1 parent 4f096e2 commit 8f61dca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions scaleway/resource_lb_backend_beta.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ func resourceScalewayLbBackendBetaCreate(d *schema.ResourceData, m interface{})
Port: int32(healthCheckPort),
CheckMaxRetries: int32(d.Get("health_check_max_retries").(int)),
CheckTimeout: expandDuration(d.Get("health_check_timeout")),
CheckDelay: expandDuration(d.Get("health_check_delay")),
TCPConfig: expandLbHCTCP(d.Get("health_check_tcp")),
HTTPConfig: expandLbHCHTTP(d.Get("health_check_http")),
HTTPSConfig: expandLbHCHTTPS(d.Get("health_check_https")),
Expand Down Expand Up @@ -295,6 +296,7 @@ func resourceScalewayLbBackendBetaRead(d *schema.ResourceData, m interface{}) er
d.Set("health_check_port", res.HealthCheck.Port)
d.Set("health_check_max_retries", res.HealthCheck.CheckMaxRetries)
d.Set("health_check_timeout", flattenDuration(res.HealthCheck.CheckTimeout))
d.Set("health_check_delay", flattenDuration(res.HealthCheck.CheckDelay))
d.Set("on_marked_down_action", flattenLbBackendMarkdownAction(res.OnMarkedDownAction))
d.Set("health_check_tcp", flattenLbHCTCP(res.HealthCheck.TCPConfig))
d.Set("health_check_http", flattenLbHCHTTP(res.HealthCheck.HTTPConfig))
Expand Down Expand Up @@ -337,6 +339,7 @@ func resourceScalewayLbBackendBetaUpdate(d *schema.ResourceData, m interface{})
Port: int32(d.Get("health_check_port").(int)),
CheckMaxRetries: int32(d.Get("health_check_max_retries").(int)),
CheckTimeout: expandDuration(d.Get("health_check_timeout")),
CheckDelay: expandDuration(d.Get("health_check_delay")),
HTTPConfig: expandLbHCHTTP(d.Get("health_check_http")),
HTTPSConfig: expandLbHCHTTPS(d.Get("health_check_https")),
}
Expand Down
6 changes: 6 additions & 0 deletions scaleway/resource_lb_backend_beta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ func TestAccScalewayLbBackendBeta(t *testing.T) {
resource.TestCheckResourceAttr("scaleway_lb_backend_beta.bkd01", "on_marked_down_action", "none"),
resource.TestCheckResourceAttr("scaleway_lb_backend_beta.bkd01", "health_check_timeout", "30s"),
resource.TestCheckResourceAttr("scaleway_lb_backend_beta.bkd01", "health_check_port", "80"),
resource.TestCheckResourceAttr("scaleway_lb_backend_beta.bkd01", "health_check_delay", "60s"),
resource.TestCheckResourceAttr("scaleway_lb_backend_beta.bkd01", "health_check_max_retries", "2"),
resource.TestCheckResourceAttrPair("scaleway_lb_backend_beta.bkd01", "server_ips.0", "scaleway_instance_ip.ip01", "address"),
),
Expand Down Expand Up @@ -70,6 +71,7 @@ func TestAccScalewayLbBackendBeta(t *testing.T) {
timeout_connect = "2.5s"
timeout_tunnel = "3s"
health_check_timeout = "15s"
health_check_delay = "10s"
health_check_port = 81
health_check_max_retries = 3
on_marked_down_action = "shutdown_sessions"
Expand All @@ -78,6 +80,10 @@ func TestAccScalewayLbBackendBeta(t *testing.T) {
Check: resource.ComposeTestCheckFunc(
testAccCheckScalewayLbBackendBetaExists("scaleway_lb_backend_beta.bkd01"),
resource.TestCheckResourceAttrPair("scaleway_lb_backend_beta.bkd01", "server_ips.0", "scaleway_instance_ip.ip02", "address"),
resource.TestCheckResourceAttr("scaleway_lb_backend_beta.bkd01", "health_check_delay", "10s"),
resource.TestCheckResourceAttr("scaleway_lb_backend_beta.bkd01", "health_check_timeout", "15s"),
resource.TestCheckResourceAttr("scaleway_lb_backend_beta.bkd01", "health_check_port", "81"),
resource.TestCheckResourceAttr("scaleway_lb_backend_beta.bkd01", "health_check_max_retries", "3"),
resource.TestCheckResourceAttr("scaleway_lb_backend_beta.bkd01", "on_marked_down_action", "shutdown_sessions"),
),
},
Expand Down

0 comments on commit 8f61dca

Please sign in to comment.