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

Add message_type support to syslog logging configuration #30

Merged
merged 4 commits into from
Aug 8, 2017

Conversation

dbeckham
Copy link
Contributor

@dbeckham dbeckham commented Aug 8, 2017

This change adds message_type support to the fastly_service_v1 resource. The changes were made in a similar to the changes made for message type in s3logging.

NOTE: in order to support the new message type, the github.com/sethvargo/go-fastly library had to be updated, as support for the syslog message_typeAPI property was only just recently added. Along with the syslog changes, the author of go-fastly has also modified the directory structure of the library, such that the import path had to be changed from github.com/sethvargo/go-fastly to github.com/sethvargo/go-fastly/fastly. I've committed these changes in multiple, logical changesets to make it easy to see the actual changes at each step.

  • Acceptance tests have been written and all pass against an active Fastly account.
  • Documentation has been written for the new parameter.

This fixes #26.

Updated to 0.4.1 for `message_type` support in syslog

NOTE: the import path has changed since this library was last imported:

`github.com/sethvargo/go-fastly`

is now

`github.com/sethvargo/go-fastly/fastly`
This uses a similar method as the same change made to the s3logging log
configuration.
Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

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

Hey there! This looks great! I did run all the tests and found TestAccFastlyServiceV1_s3logging_domain_default fails with message Bad match S3 logging match. Looks like the new S3 logging info contains MessageType:"classic", where as we're expecting an empty one? Most likely just an oversight in a test struct used for comparison.

Full message:

--- FAIL: TestAccFastlyServiceV1_s3logging_domain_default (14.05s)
        testing.go:428: Step 0 error: Check failed: Check 2/5 error: Bad match S3 logging match, expected (&fastly.S3{ServiceID:"nJCCDGA4x2GmAo4ZJzTrq", Version:1, Name:"somebucketlog", BucketName:"fastlytestlogging", Domain:"s3.amazonaws.com", AccessKey:"somekey", SecretKey:"somesecret", Path:"", Period:0xe10, GzipLevel:0x0, Format:"%h %l %u %t %r %>s", FormatVersion:0x1, ResponseCondition:"response_condition_test", MessageType:"", TimestampFormat:"%Y-%m-%dT%H:%M:%S.000", Redundancy:"", CreatedAt:(*time.Time)(nil), UpdatedAt:(*time.Time)(nil), DeletedAt:(*time.Time)(nil)}), got (&fastly.S3{ServiceID:"nJCCDGA4x2GmAo4ZJzTrq", Version:1, Name:"somebucketlog", BucketName:"fastlytestlogging", Domain:"s3.amazonaws.com", AccessKey:"somekey", SecretKey:"somesecret", Path:"", Period:0xe10, GzipLevel:0x0, Format:"%h %l %u %t %r %>s", FormatVersion:0x1, ResponseCondition:"response_condition_test", MessageType:"classic", TimestampFormat:"%Y-%m-%dT%H:%M:%S.000", Redundancy:"", CreatedAt:(*time.Time)(nil), UpdatedAt:(*time.Time)(nil), DeletedAt:(*time.Time)(nil)})

@dbeckham
Copy link
Contributor Author

dbeckham commented Aug 8, 2017

@catsby These acceptance errors already existed before my changes, but they were just fixed in #28. I'll merge the latest master changes into this branch and push again.

@dbeckham
Copy link
Contributor Author

dbeckham commented Aug 8, 2017

Ok, that should fix the (unrelated) S3 logging tests that were previously failing.

Copy link
Contributor

@catsby catsby left a comment

Choose a reason for hiding this comment

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

Checks out, thanks!

==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./fastly -v -run=TestAccFastlyServiceV1_ -timeout 120m
=== RUN   TestAccFastlyServiceV1_conditional_basic
--- PASS: TestAccFastlyServiceV1_conditional_basic (18.28s)
=== RUN   TestAccFastlyServiceV1_gcslogging
--- PASS: TestAccFastlyServiceV1_gcslogging (17.30s)
=== RUN   TestAccFastlyServiceV1_gcslogging_env
--- PASS: TestAccFastlyServiceV1_gcslogging_env (17.18s)
=== RUN   TestAccFastlyServiceV1_gzips_basic
--- PASS: TestAccFastlyServiceV1_gzips_basic (41.79s)
=== RUN   TestAccFastlyServiceV1_headers_basic
--- PASS: TestAccFastlyServiceV1_headers_basic (41.58s)
=== RUN   TestAccFastlyServiceV1_healthcheck_basic
--- PASS: TestAccFastlyServiceV1_healthcheck_basic (39.39s)
=== RUN   TestAccFastlyServiceV1_papertrail_basic
--- PASS: TestAccFastlyServiceV1_papertrail_basic (40.15s)
=== RUN   TestAccFastlyServiceV1_response_object_basic
--- PASS: TestAccFastlyServiceV1_response_object_basic (41.42s)
=== RUN   TestAccFastlyServiceV1_s3logging_basic
--- PASS: TestAccFastlyServiceV1_s3logging_basic (44.90s)
=== RUN   TestAccFastlyServiceV1_s3logging_domain_default
--- PASS: TestAccFastlyServiceV1_s3logging_domain_default (19.34s)
=== RUN   TestAccFastlyServiceV1_s3logging_s3_env
--- PASS: TestAccFastlyServiceV1_s3logging_s3_env (19.65s)
=== RUN   TestAccFastlyServiceV1_s3logging_formatVersion
--- PASS: TestAccFastlyServiceV1_s3logging_formatVersion (19.61s)
=== RUN   TestAccFastlyServiceV1_sumologic
--- PASS: TestAccFastlyServiceV1_sumologic (19.72s)
=== RUN   TestAccFastlyServiceV1_syslog_basic
--- PASS: TestAccFastlyServiceV1_syslog_basic (45.17s)
=== RUN   TestAccFastlyServiceV1_syslog_formatVersion
--- PASS: TestAccFastlyServiceV1_syslog_formatVersion (19.11s)
=== RUN   TestAccFastlyServiceV1_updateDomain
--- PASS: TestAccFastlyServiceV1_updateDomain (40.56s)
=== RUN   TestAccFastlyServiceV1_updateBackend
--- PASS: TestAccFastlyServiceV1_updateBackend (41.69s)
=== RUN   TestAccFastlyServiceV1_basic
--- PASS: TestAccFastlyServiceV1_basic (16.95s)
=== RUN   TestAccFastlyServiceV1_disappears
--- PASS: TestAccFastlyServiceV1_disappears (8.60s)
=== RUN   TestAccFastlyServiceV1_defaultTTL
--- PASS: TestAccFastlyServiceV1_defaultTTL (63.30s)
=== RUN   TestAccFastlyServiceV1_VCL_basic
--- PASS: TestAccFastlyServiceV1_VCL_basic (39.70s)
PASS
ok      github.com/terraform-providers/terraform-provider-fastly/fastly 655.374s

@catsby catsby merged commit 2a53121 into fastly:master Aug 8, 2017
phamann pushed a commit that referenced this pull request Aug 10, 2020
* WAF documentation enhancements
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

syslog logging - not all configuration available
2 participants