Skip to content

Commit 91656ae

Browse files
authored
Merge pull request #428 from Arnoways/dev/arnoways/iploadbalancing_proxy_protocol
resource_iploadbalancing_tcp_farm_server: skip validate func for prox…
2 parents df58efa + 5c29e4b commit 91656ae

4 files changed

+12
-6
lines changed

ovh/resource_iploadbalancing_http_farm_server.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,11 @@ func resourceIpLoadbalancingHttpFarmServer() *schema.Resource {
6464
Type: schema.TypeString,
6565
Optional: true,
6666
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
67-
err := helpers.ValidateStringEnum(v.(string), []string{"v1", "v2", "v2-ssl", "v2-ssl-cn"})
68-
if err != nil {
69-
errors = append(errors, err)
67+
if v != nil {
68+
err := helpers.ValidateStringEnum(v.(string), []string{"v1", "v2", "v2-ssl", "v2-ssl-cn"})
69+
if err != nil {
70+
errors = append(errors, err)
71+
}
7072
}
7173
return
7274
},

ovh/resource_iploadbalancing_http_farm_server_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,7 @@ func TestAccIpLoadbalancingHttpFarmServerBasic(t *testing.T) {
318318
resource.TestCheckResourceAttr(TEST_ACC_IPLOADBALANCING_HTTP_FARM_SRV_RES_NAME, "ssl", "true"),
319319
resource.TestCheckResourceAttr(TEST_ACC_IPLOADBALANCING_HTTP_FARM_SRV_RES_NAME, "backup", "true"),
320320
resource.TestCheckResourceAttr(TEST_ACC_IPLOADBALANCING_HTTP_FARM_SRV_RES_NAME, "on_marked_down", "shutdown-sessions"),
321+
resource.TestCheckNoResourceAttr(TEST_ACC_IPLOADBALANCING_HTTP_FARM_SRV_RES_NAME, "proxy_protocol_version"),
321322
),
322323
},
323324
{

ovh/resource_iploadbalancing_tcp_farm_server.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,11 @@ func resourceIpLoadbalancingTcpFarmServer() *schema.Resource {
6060
Type: schema.TypeString,
6161
Optional: true,
6262
ValidateFunc: func(v interface{}, k string) (ws []string, errors []error) {
63-
err := helpers.ValidateStringEnum(v.(string), []string{"v1", "v2", "v2-ssl", "v2-ssl-cn"})
64-
if err != nil {
65-
errors = append(errors, err)
63+
if v != nil {
64+
err := helpers.ValidateStringEnum(v.(string), []string{"v1", "v2", "v2-ssl", "v2-ssl-cn"})
65+
if err != nil {
66+
errors = append(errors, err)
67+
}
6668
}
6769
return
6870
},

ovh/resource_iploadbalancing_tcp_farm_server_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,6 +303,7 @@ func TestAccIpLoadbalancingTcpFarmServerBasic(t *testing.T) {
303303
resource.TestCheckResourceAttr("ovh_iploadbalancing_tcp_farm_server.testacc", "weight", "1"),
304304
resource.TestCheckResourceAttr("ovh_iploadbalancing_tcp_farm_server.testacc", "ssl", "true"),
305305
resource.TestCheckResourceAttr("ovh_iploadbalancing_tcp_farm_server.testacc", "backup", "true"),
306+
resource.TestCheckNoResourceAttr("ovh_iploadbalancing_tcp_farm_server.testacc", "proxy_protocol_version"),
306307
),
307308
},
308309
{

0 commit comments

Comments
 (0)