From c803ea5358951f2c47b471b21fbf9cab76e4889c Mon Sep 17 00:00:00 2001 From: Andrew Starr-Bochicchio Date: Fri, 2 Feb 2024 17:14:54 -0500 Subject: [PATCH] redis config: allow setting timeout to 0 (#1108) --- digitalocean/database/resource_database_redis_config.go | 2 +- digitalocean/database/resource_database_redis_config_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/digitalocean/database/resource_database_redis_config.go b/digitalocean/database/resource_database_redis_config.go index 72749c12a..584ed4d98 100644 --- a/digitalocean/database/resource_database_redis_config.go +++ b/digitalocean/database/resource_database_redis_config.go @@ -169,7 +169,7 @@ func updateRedisConfig(ctx context.Context, d *schema.ResourceData, client *godo opts.RedisSSL = godo.PtrTo(v.(bool)) } - if v, ok := d.GetOk("timeout"); ok { + if v, ok := d.GetOkExists("timeout"); ok { opts.RedisTimeout = godo.PtrTo(v.(int)) } diff --git a/digitalocean/database/resource_database_redis_config_test.go b/digitalocean/database/resource_database_redis_config_test.go index 2cc7ad980..5b7185420 100644 --- a/digitalocean/database/resource_database_redis_config_test.go +++ b/digitalocean/database/resource_database_redis_config_test.go @@ -33,12 +33,12 @@ func TestAccDigitalOceanDatabaseRedisConfig_Basic(t *testing.T) { ), }, { - Config: fmt.Sprintf(testAccCheckDigitalOceanDatabaseRedisConfigConfigBasic, dbConfig, "allkeys-lru", 600, "KEA"), + Config: fmt.Sprintf(testAccCheckDigitalOceanDatabaseRedisConfigConfigBasic, dbConfig, "allkeys-lru", 0, "KEA"), Check: resource.ComposeTestCheckFunc( resource.TestCheckResourceAttr( "digitalocean_database_redis_config.foobar", "maxmemory_policy", "allkeys-lru"), resource.TestCheckResourceAttr( - "digitalocean_database_redis_config.foobar", "timeout", "600"), + "digitalocean_database_redis_config.foobar", "timeout", "0"), resource.TestCheckResourceAttr( "digitalocean_database_redis_config.foobar", "notify_keyspace_events", "KEA"), resource.TestCheckResourceAttr(