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

Safely deprecate value #3674

Merged
merged 2 commits into from
Aug 20, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .changelog/3674.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:note
resource/cloudflare_record: fix a bug that prematurely removed the ability to set the deprecated `value` field.
```
9 changes: 9 additions & 0 deletions internal/sdkv2provider/resource_cloudflare_record.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,15 @@ func resourceCloudflareRecordCreate(ctx context.Context, d *schema.ResourceData,
newRecord.Content = content.(string)
}

if contentOk == valueOk {
return diag.FromErr(fmt.Errorf(
"'content' (present: %t) must not be set with 'value' (present: %t)",
contentOk, valueOk))
}
if valueOk {
contentOk = true
}

data, dataOk := d.GetOk("data")
tflog.Debug(ctx, fmt.Sprintf("Data found in config: %#v", data))

Expand Down
Loading