Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
New datasource: tfe_oauth_client #212
New datasource: tfe_oauth_client #212
Changes from 2 commits
acedff3
fc76018
a2fdaa8
a02447a
24ff6e9
e035714
c8ee172
9cc8edb
8918339
175f552
a77037d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
just a question for my own learning: i've never seen this before. i read about it in the docs and it makes sense. is this something we should be doing in all of our resources/data sources that have a blank/empty context?
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 created an empty context because I needed one to pass to the tfe client.
Perhaps in the long run we could (should?) revisit the codebase and set a context with a timeout (https://godoc.org/context#WithTimeout).
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.
do you think it is worth handling this case the way we do in the resource? in case the oauth client doesn't have an oauth token yet?
like this: https://github.com/terraform-providers/terraform-provider-tfe/blob/master/tfe/resource_tfe_oauth_client.go#L130
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.
can confirm that we need to handle this similar to how we handle it in the resource. this panics if you give it the oauth client id of an unfinished client (so a client that doesn't have an oauth token yet)
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.
Thanks for the hint!