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

Correctly set multi_script on Enterprise worker imports #124

Merged

Conversation

jacobbednarz
Copy link
Member

This updates the import for cloudflare_worker_route resource. Prior to
this it relied on d.Get("script_name") which was never accessible so
it would always return an empty string (even when using
getRouteFromResource).

With this change, it now queries the Cloudflare API fetching all worker
routes and when the route ID matches one in the API response, it will
set the isEnterpriseWorker flag to true which will correctly set the
multi_script option. This includes the prerequisitie that the
organisation ID must also be set to enable it which maintains
compatibility with the existing behaviour.

Fixes #123

This updates the import for `cloudflare_worker_route` resource. Prior to
this it relied on `d.Get("script_name")` which was never accessible so
it would always return an empty string (even when using
`getRouteFromResource`).

With this change, it now queries the Cloudflare API fetching all worker
routes and when the route ID matches one in the API response, it will
set the `isEnterpriseWorker` flag to `true` which will correctly set the
`multi_script` option. This includes the prerequisitie that the
organisation ID must also be set to enable it which maintains
compatibility with the existing behaviour.

Fixes #123
@patryk
Copy link

patryk commented Oct 15, 2018

Thanks Jacob!

@patryk patryk merged commit 739e4b8 into cloudflare:master Oct 15, 2018
@jacobbednarz jacobbednarz deleted the fix-enterprise-worker-route-import branch October 15, 2018 20:32
@amogozov
Copy link

Is it possible to release new version with this change? It prevents us from terraforming all workers :)

@jacobbednarz
Copy link
Member Author

jacobbednarz commented Oct 30, 2018 via email

@jacobbednarz
Copy link
Member Author

jacobbednarz commented Oct 30, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants