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 support for FTP logging #235

Merged
merged 2 commits into from
Jun 11, 2020
Merged

Add support for FTP logging #235

merged 2 commits into from
Jun 11, 2020

Conversation

ezkl
Copy link
Contributor

@ezkl ezkl commented May 19, 2020

Adds support for configuring FTP log streaming (API docs) to provider.

cc: @phamann

Copy link
Collaborator

@mccurdyc mccurdyc left a comment

Choose a reason for hiding this comment

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

@ezkl should we stick with the pattern of the logging suffix (i.e., ftplogging) rather than changing to use logging_ as a prefix, just for consistency with what already exists?

This would be the only necessary change that I see worth going back and applying.

cc @phamann

Description: "The unique name of the FTP logging endpoint",
},

"address": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just making note that for FTP we don't explicitly expose IPV4 or Hostname because Address includes these values.

https://developer.fastly.com/reference/api/logging/ftp/

Comment on lines 189 to 194
if errRes, ok := err.(*fst.HTTPError); ok {
if errRes.StatusCode != 404 {
return err
}
} else if err != nil {
return err
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Wouldn't a 404 error returned from DeleteFTP result in a nil error being returned from this function? Is that expected?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Why can't we simply have the following here:

return conn.DeleteFTP(i)

@@ -1574,6 +1575,7 @@ func resourceServiceV1Update(d *schema.ResourceData, meta interface{}) error {
"splunk",
"blobstoragelogging",
"httpslogging",
"logging_ftp",
Copy link
Collaborator

Choose a reason for hiding this comment

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

@ezkl should we stick with the pattern of the logging suffix (i.e., ftplogging) rather than changing to use logging_ as a prefix, just for consistency with what already exists?

This would be the only necessary change that I see worth going back and applying.

cc @phamann

Copy link
Member

Choose a reason for hiding this comment

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

I agree with this decision of starting to introduce consistency with logging_foo

@mccurdyc
Copy link
Collaborator

Force-pushed rebasing master.

@mccurdyc
Copy link
Collaborator

Force-pushed rebasing master.

@mccurdyc mccurdyc force-pushed the ezkl/add-ftp branch 2 times, most recently from fc903ab to 6b55c98 Compare June 10, 2020 21:08
path = "/path"
port = 27
format = "%%h %%l %%u %%t \"%%r\" %%>s %%b"
gzip_level = 3
Copy link
Collaborator

Choose a reason for hiding this comment

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

This really bothers me. This must be my tab width or something. It looks fine locally.

It would be nice if we could leverage Terraform's terraform fmt. Maybe if we pulled these out into *.tf test fixtures?

But I also kind of don't like pulling the test data that far from the test itself. Thoughts? Other ideas?

Copy link
Member

Choose a reason for hiding this comment

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

I think the idea of .tf test fixtures to solve this issue, though does add some overhead to adding tests.

@mccurdyc mccurdyc force-pushed the ezkl/add-ftp branch 2 times, most recently from 87fc21e to f19b4dc Compare June 11, 2020 13:17
Address: "ftp2.example.com",
Username: "user",
Password: "p@ssw0rd2",
PublicKey: pgpPublicKey() + "\n", // The '\n' is necessary becaue of the heredocs (i.e., EOF) in the config below.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note this ugly + "\n" and accompanying comment.

This is b/c of this.

Copy link
Member

@phamann phamann left a comment

Choose a reason for hiding this comment

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

👍 LGTM

@mccurdyc mccurdyc force-pushed the ezkl/add-ftp branch 2 times, most recently from ae1c1e1 to 66d909d Compare June 11, 2020 14:11
@phamann phamann merged commit 463be28 into fastly:master Jun 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants