-
Notifications
You must be signed in to change notification settings - Fork 630
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
add compatibility_flags to cloudflare_workers_script #2324
Conversation
changelog detected ✅ |
@@ -159,6 +159,15 @@ func resourceCloudflareWorkerScriptSchema() map[string]*schema.Schema { | |||
Optional: true, | |||
Description: "The date to use for the compatibility flag.", | |||
}, | |||
"compatibility_flags": { | |||
Type: schema.TypeList, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given that we don't care about ordering, let's use a TypeSet
here.
@@ -131,6 +131,14 @@ func parseWorkerBindings(d *schema.ResourceData, bindings ScriptBindings) { | |||
} | |||
} | |||
|
|||
func getCompatibilityFlags(d *schema.ResourceData) []string { | |||
compatibilityFlags := make([]string, 0) | |||
for _, item := range d.Get("compatibility_flags").([]interface{}) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when you swap to a TypeSet
this will become
for _, item := range d.Get("compatibility_flags").([]interface{}) { | |
for _, item := range d.Get("compatibility_flags").(*schema.Set).List() { |
very close to getting this sorted! for next time, if you use a non-master branch and allow maintainers to edit the PR, we'll be able to fix these sorts of things without having the back and forth :) |
Good shout, will bear that in mind :) thank you |
acceptance tests all passing
|
This functionality has been released in v4.3.0 of the Terraform Cloudflare Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Adds
compatibility_flags
attribute to workers script resource.Following up on this issue here where compatibility_date was added.