-
Notifications
You must be signed in to change notification settings - Fork 754
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
datasource/github_ip_ranges: implement ip datasource via the GH Meta api #82
Conversation
This would address #78 (just linking it in here). |
|
||
func dataSourceGithubIpRangesRead(d *schema.ResourceData, meta interface{}) error { | ||
client := meta.(*Organization).client | ||
ctx := context.Background() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be the StopContext
?
implement acceptance tests update docs
} | ||
|
||
if len(api.Hooks)+len(api.Git)+len(api.Pages) > 0 { | ||
d.SetId("github-ip-ranges") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what to set here? I suppose it doesn't matter in this case? Anyone let me know!
These are all always IPv4 I think? Just want to confirm that, and possibly document it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, may want to have someone else confirm the const ID is fine, I don't know about that, I've seen like Now
as well.
@paultyng the /meta endpoint gives examples that are IPv4 but there doesn't appear to be any docs that guarantee it. Let me know if you want me to change any documentation. Also I opened a PR to go-github to get the last set (importer) we could wait on that PR and then update this one with full coverage! |
I'd say just link your PR in a |
This was released in v1.1.0 |
datasource/github_ip_ranges: implement ip datasource via the GH Meta api
Fix #78
Implemented data source to pull github's ip addresses. Rigged up the StopContext to pass through to the api call (should probably be done elsewhere in the provider as well).
One of the ip sets (importer) is not yet implemented in the
go-github
library. I'll open a PR for that so we can polish off this data source in a follow up PR.go-github PR google/go-github#881