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

azurerm_redis_cache: support new maxmemory policies allkeys-lfu' & 'volatile-lfu #7031

Merged
merged 1 commit into from May 20, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion azurerm/internal/services/redis/resource_arm_redis_cache.go
Expand Up @@ -900,10 +900,12 @@ func validateRedisMaxMemoryPolicy(v interface{}, _ string) (warnings []string, e
"allkeys-random": true,
"volatile-random": true,
"volatile-ttl": true,
"allkeys-lfu": true,
"volatile-lfu": true,
}

if !families[value] {
errors = append(errors, fmt.Errorf("Redis Max Memory Policy can only be 'noeviction' / 'allkeys-lru' / 'volatile-lru' / 'allkeys-random' / 'volatile-random' / 'volatile-ttl'"))
errors = append(errors, fmt.Errorf("Redis Max Memory Policy can only be 'noeviction' / 'allkeys-lru' / 'volatile-lru' / 'allkeys-random' / 'volatile-random' / 'volatile-ttl' / 'allkeys-lfu' / 'volatile-lfu'"))
}

return warnings, errors
Expand Down
2 changes: 2 additions & 0 deletions azurerm/internal/services/redis/validation_test.go
Expand Up @@ -57,6 +57,8 @@ func TestAccAzureRMRedisCacheMaxMemoryPolicy_validation(t *testing.T) {
{Value: "allkeys-random", ErrCount: 0},
{Value: "volatile-random", ErrCount: 0},
{Value: "volatile-ttl", ErrCount: 0},
{Value: "allkeys-lfu", ErrCount: 0},
{Value: "volatile-lfu", ErrCount: 0},
{Value: "something-else", ErrCount: 1},
}

Expand Down