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

fix(userconfig/converters): missing negation in ip_filter safeguard #1644

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/sdkprovider/userconfig/converters/converters.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func Expand(kind string, s *schema.Schema, d *schema.ResourceData) (map[string]a

// TODO: Move to a validation part of the schema.
if v, ok := dto["ip_filter"].([]any); ok && len(v) == 0 {
if _, ok := os.LookupEnv("AIVEN_ALLOW_IP_FILTER_PURGE"); ok {
if _, ok := os.LookupEnv("AIVEN_ALLOW_IP_FILTER_PURGE"); !ok {
return nil, fmt.Errorf(
"ip_filter list is empty, but AIVEN_ALLOW_IP_FILTER_PURGE is not set. Please set " +
"AIVEN_ALLOW_IP_FILTER_PURGE to confirm that you want to remove all IP filters, which is going " +
Expand Down