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

provider/cloudflare: Add proxied option #5508

Merged
merged 1 commit into from
Apr 27, 2016
Merged

provider/cloudflare: Add proxied option #5508

merged 1 commit into from
Apr 27, 2016

Conversation

xla
Copy link
Contributor

@xla xla commented Mar 8, 2016

This change adds the support for the proxied configuration option for a record which enables origin protection for CloudFlare records.

In order to do so the golang library needed to be changed as the old did not support the option and was using and outdated API version.

There are a couple of open issues which ask for this (#5049, #3805).


I was uncertain about the dependency changes and how that is reflected. How are they managed and how can they be changed and bumped?

},

"proxied": &schema.Schema{
Type: schema.TypeBool,
Optional: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally for bools we just reflect the upstream default w/ Default: false, then below instead of checking GetOk you can simply set d.Get("proxied").(bool) directly.

@phinze
Copy link
Contributor

phinze commented Mar 10, 2016

@xla on first review this is looking really nice!

You can find docs about vendoring the new library here: https://github.com/hashicorp/terraform#adding-a-dependency

As for removing the old library - it looks like that has to be done manually by editing the Godeps/Godeps.json and removing the path in vendor/.

If you like, you can just do the addition of the new library on this PR to get the build passing, and we can take care of the cleanup of the old library on master. 👍

@xla
Copy link
Contributor Author

xla commented Mar 16, 2016

@phinze Thanks for the quick follow-up. I incorporated your feedback, unfortunately trying to add the dependency results in either errors or a hanging godep executable. Maybe you have a reproducible way, so I added you as collaborator in case you find the time to check out the branch.

@xla
Copy link
Contributor Author

xla commented Apr 19, 2016

@phinze Was able to add the missing dependency and the build is green. Unfortunately CloudFlare changed a type returned in the paging part of their API so that this PR is blocked by crackcomm/cloudflare#4.

@xla
Copy link
Contributor Author

xla commented Apr 19, 2016

@phinze Good to go from my side.

This change adds the support for the proxied configuration option for a
record which enables origin protection for CloudFlare records.

In order to do so the golang library needed to be changed as the old did
not support the option and was using and outdated API version.

Open issues which ask for this (#5049, #3805).
@stack72
Copy link
Contributor

stack72 commented Apr 27, 2016

Tests pass as expected and the deps have been vendored now :)

TF_LOG=1 make testacc TEST=./builtin/providers/cloudflare TESTARGS='-run=TestAccCloudFlareRecord' 2>~/tf.log
==> Checking that code complies with gofmt requirements...
/Users/stacko/Code/go/bin/stringer
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/cloudflare -v -run=TestAccCloudFlareRecord -timeout 120m
=== RUN   TestAccCloudFlareRecord_Basic
--- PASS: TestAccCloudFlareRecord_Basic (5.76s)
=== RUN   TestAccCloudFlareRecord_Proxied
--- PASS: TestAccCloudFlareRecord_Proxied (5.24s)
=== RUN   TestAccCloudFlareRecord_Updated
--- PASS: TestAccCloudFlareRecord_Updated (6.29s)
=== RUN   TestAccCloudFlareRecord_forceNewRecord
--- PASS: TestAccCloudFlareRecord_forceNewRecord (7.95s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/cloudflare 25.254s

@stack72 stack72 merged commit 2510755 into hashicorp:master Apr 27, 2016
@stack72
Copy link
Contributor

stack72 commented Apr 27, 2016

Thanks for all the follow up work here @xla :)

xsellier pushed a commit to xsellier/terraform that referenced this pull request May 17, 2016
This change adds the support for the proxied configuration option for a
record which enables origin protection for CloudFlare records.

In order to do so the golang library needed to be changed as the old did
not support the option and was using and outdated API version.

Open issues which ask for this (hashicorp#5049, hashicorp#3805).
@ghost
Copy link

ghost commented Apr 26, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants