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/fastly Adds papertrail logging #11491

Merged
merged 7 commits into from
Jan 30, 2017

Conversation

travertischio
Copy link
Contributor

@travertischio travertischio commented Jan 28, 2017

Allows the user to point a log stream from fastly to an existing papertrail resource.

Fastly API

  • Tests included
  • Website documentation included

@stack72
Copy link
Contributor

stack72 commented Jan 29, 2017

Hi @travertischio

Thanks for the work here - unfortunately, this code causes a panic:

=== RUN   TestAccFastlyServiceV1_papertrail_basic
panic: interface conversion: interface is nil, not string

goroutine 7148 [running]:
panic(0x54c6e0, 0xc4202af740)
	/usr/local/Cellar/go/1.7.4_1/libexec/src/runtime/panic.go:500 +0x1a1
github.com/hashicorp/terraform/builtin/providers/fastly.resourceServiceV1Update(0xc420019680, 0x5060c0, 0xc42002ca40, 0x0, 0x0)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/fastly/resource_fastly_service_v1.go:1109 +0x30e7
github.com/hashicorp/terraform/builtin/providers/fastly.resourceServiceV1Create(0xc420019680, 0x5060c0, 0xc42002ca40, 0x2900, 0xd514)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/builtin/providers/fastly/resource_fastly_service_v1.go:617 +0x17b
github.com/hashicorp/terraform/helper/schema.(*Resource).Apply(0xc420019320, 0xc42042a460, 0xc4203c5a60, 0x5060c0, 0xc42002ca40, 0xc420014d01, 0x35, 0x0)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/resource.go:162 +0x30e
github.com/hashicorp/terraform/helper/schema.(*Provider).Apply(0xc420019380, 0xc42040f180, 0xc42042a460, 0xc4203c5a60, 0x1, 0xc29f2, 0x2900)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/helper/schema/provider.go:212 +0x9b
github.com/hashicorp/terraform/terraform.(*EvalApply).Eval(0xc4201028c0, 0x865340, 0xc4200f1790, 0x2, 0x2, 0x5de78c, 0x4)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/terraform/eval_apply.go:57 +0x24e
github.com/hashicorp/terraform/terraform.EvalRaw(0x85a6a0, 0xc4201028c0, 0x865340, 0xc4200f1790, 0x0, 0x0, 0x0, 0x0)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/terraform/eval.go:53 +0x17f
github.com/hashicorp/terraform/terraform.(*EvalSequence).Eval(0xc4203c4d20, 0x865340, 0xc4200f1790, 0x2, 0x2, 0x5de78c, 0x4)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/terraform/eval_sequence.go:10 +0x6c
github.com/hashicorp/terraform/terraform.EvalRaw(0x85afe0, 0xc4203c4d20, 0x865340, 0xc4200f1790, 0x85afe0, 0xc4203c4d20, 0xc4203c4ea0, 0x15)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/terraform/eval.go:53 +0x17f
github.com/hashicorp/terraform/terraform.Eval(0x85afe0, 0xc4203c4d20, 0x865340, 0xc4200f1790, 0xc4203c4d20, 0x85afe0, 0xc4203c4d20, 0x0)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/terraform/eval.go:34 +0x53
github.com/hashicorp/terraform/terraform.(*Graph).walk.func1(0x5bed00, 0xc42002c7c0, 0x0, 0x0)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/terraform/graph.go:245 +0xe7c
github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk.func3(0xc420330eb0, 0xc42040eeb0, 0xc420330dd8, 0xc4203c2210, 0xc420330ec0, 0x5bed00, 0xc42002c7c0, 0xc420018ae0, 0xc420018c60)
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:246 +0x251
created by github.com/hashicorp/terraform/dag.(*AcyclicGraph).Walk
	/Users/stacko/Code/go/src/github.com/hashicorp/terraform/dag/dag.go:255 +0x6a6
exit status 2

Thanks

Paul

@stack72 stack72 added the waiting-response An issue/pull request is waiting for a response from the community label Jan 29, 2017
@travertischio
Copy link
Contributor Author

@stack72

Sorry about that, it looks like I just messed up some naming assignments. I think this should be good now.

@stack72
Copy link
Contributor

stack72 commented Jan 30, 2017

thanks for the fast fix @travertischio - retesting now :)

@stack72
Copy link
Contributor

stack72 commented Jan 30, 2017

ok @travertischio

1 more issue I'm afraid

=== RUN   TestAccFastlyServiceV1_papertrail_basic
--- FAIL: TestAccFastlyServiceV1_papertrail_basic (5.35s)
	testing.go:265: Step 0 error: Error applying: 1 error(s) occurred:

		* fastly_service_v1.foo: 400 - Bad Request
		Message: An error occurred while connecting to the fastly API, please try your request again.
		Detail: Address 'fastlytest.papretrail.log' is not a valid IPv4, IPv6 or hostname

@travertischio
Copy link
Contributor Author

@stack72

Sorry for the little mistakes here. Those testing addresses should be accepted by the API now.

@stack72
Copy link
Contributor

stack72 commented Jan 30, 2017

Nothing to apologise for at all - you are incredibly responsive to fixing them :) This now LGTM! Thanks so much for all the help here

% make testacc TEST=./builtin/providers/fastly                                                                                            ✭
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /terraform/vendor/)
2017/01/30 15:54:54 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/fastly -v  -timeout 120m
=== RUN   TestAccFastlyIPRanges
--- PASS: TestAccFastlyIPRanges (1.49s)
=== RUN   TestProvider
--- PASS: TestProvider (0.00s)
=== RUN   TestProvider_impl
--- PASS: TestProvider_impl (0.00s)
=== RUN   TestAccFastlyServiceV1CacheSetting_basic
--- PASS: TestAccFastlyServiceV1CacheSetting_basic (42.72s)
=== RUN   TestAccFastlyServiceV1_conditional_basic
--- PASS: TestAccFastlyServiceV1_conditional_basic (20.71s)
=== RUN   TestFastlyServiceV1_FlattenGzips
--- PASS: TestFastlyServiceV1_FlattenGzips (0.00s)
=== RUN   TestAccFastlyServiceV1_gzips_basic
--- PASS: TestAccFastlyServiceV1_gzips_basic (48.26s)
=== RUN   TestFastlyServiceV1_BuildHeaders
--- PASS: TestFastlyServiceV1_BuildHeaders (0.00s)
=== RUN   TestAccFastlyServiceV1_headers_basic
--- PASS: TestAccFastlyServiceV1_headers_basic (51.45s)
=== RUN   TestAccFastlyServiceV1_papertrail_basic
--- PASS: TestAccFastlyServiceV1_papertrail_basic (45.33s)
=== RUN   TestAccFastlyServiceV1RequestSetting_basic
--- PASS: TestAccFastlyServiceV1RequestSetting_basic (20.26s)
=== RUN   TestAccFastlyServiceV1_s3logging_basic
--- PASS: TestAccFastlyServiceV1_s3logging_basic (43.05s)
=== RUN   TestAccFastlyServiceV1_s3logging_s3_env
--- PASS: TestAccFastlyServiceV1_s3logging_s3_env (17.97s)
=== RUN   TestResourceFastlyFlattenDomains
--- PASS: TestResourceFastlyFlattenDomains (0.00s)
=== RUN   TestResourceFastlyFlattenBackend
--- PASS: TestResourceFastlyFlattenBackend (0.00s)
=== RUN   TestAccFastlyServiceV1_updateDomain
--- PASS: TestAccFastlyServiceV1_updateDomain (45.82s)
=== RUN   TestAccFastlyServiceV1_updateBackend
--- PASS: TestAccFastlyServiceV1_updateBackend (45.89s)
=== RUN   TestAccFastlyServiceV1_basic
--- PASS: TestAccFastlyServiceV1_basic (19.43s)
=== RUN   TestAccFastlyServiceV1_disappears
--- PASS: TestAccFastlyServiceV1_disappears (10.41s)
=== RUN   TestAccFastlyServiceV1_VCL_basic
--- PASS: TestAccFastlyServiceV1_VCL_basic (49.43s)
PASS
ok  	github.com/hashicorp/terraform/builtin/providers/fastly	462.220s

Paul

@stack72 stack72 merged commit 33b43fc into hashicorp:master Jan 30, 2017
stack72 pushed a commit that referenced this pull request Jan 30, 2017
* Creates papertrail logging resource for fastly

* Adds modification support for fastly papertrail

* Flattens and lists papertrail resources

* Adds testing for fastly papertrail

* Adds papertrail documentation for fastly to the website

* Fixes schema assignment name mistake

* Changes testing hostnames to pass fastly API validation
arcadiatea pushed a commit to ticketmaster/terraform that referenced this pull request Feb 9, 2017
* Creates papertrail logging resource for fastly

* Adds modification support for fastly papertrail

* Flattens and lists papertrail resources

* Adds testing for fastly papertrail

* Adds papertrail documentation for fastly to the website

* Fixes schema assignment name mistake

* Changes testing hostnames to pass fastly API validation
@travertischio travertischio deleted the fastly-papertrail branch July 31, 2018 17:47
@ghost
Copy link

ghost commented Apr 2, 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 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement provider/fastly waiting-response An issue/pull request is waiting for a response from the community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants