-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 oidc token support #5670
Add oidc token support #5670
Conversation
I updated the Anyway, i've reverified its functionality. if the testcases are sufficient (which i actually just copied from the existing |
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.
For the merge conflict, I'd recommend just rebasing or merging on top of master. Are the go.mod changes 100% necessary? If so, they need to be done in a separate PR here and also in the beta provider, because the other changes will be upstreamed to Magic Modules (see https://github.com/terraform-providers/terraform-provider-google/blob/master/.github/CONTRIBUTING.md#autogenerated-resources). It's fine to do the review all at once here though and split it up later if that's easier.
The logic generally looks sound, though I had some style and documentation suggestions.
website/docs/d/datasource_google_service_account_id_token.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/d/datasource_google_service_account_id_token.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/d/datasource_google_service_account_id_token.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/d/datasource_google_service_account_id_token.html.markdown
Outdated
Show resolved
Hide resolved
ok, i made a number of changes:
|
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.
In order for resolve the merge conflicts that GitHub is showing, you'll still want to merge or rebase on top of master.
website/docs/d/datasource_google_service_account_id_token.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/d/datasource_google_service_account_id_token.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/d/datasource_google_service_account_id_token.html.markdown
Outdated
Show resolved
Hide resolved
website/docs/d/datasource_google_service_account_id_token.html.markdown
Outdated
Show resolved
Hide resolved
Not sure why the build failed on that documentation page (its not included in this PR)...maybe rerun travis again? |
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 left a few (untested) suggestions for how to use types instead of reflection to identify static token sources.
Here is a slightly modified example with a simplified GetCredential
call: https://play.golang.org/p/RLCXjYiZzUq.
@tbpg Thanks for the suggestions! @danawillow i'm not sure if the last |
yeah, i don't understand the docs error there...the $ make website-test
Found no broken links.
FINISHED --2020-06-29 14:41:45--
Total wall clock time: 12s
Downloaded: 323 files, 30M in 0.06s (515 MB/s)
tf-website-google-temp
make[1]: Leaving directory '/path/to/src/github.com/hashicorp/terraform-website'
$ echo $?
0 |
Oh, the website test failure is unrelated. Don't worry about it. |
ok, i added in actual tests..but here's the catch: the basic tests seem to work fine
but the one with impersonation needs a delay due to iam propagation delay. Any suggestion on how to do that ...i suppose a at the moment, the first run will do the IAM assocation but fail since the permissions to impersonate hasn't propagated
which will fail but implictly apply an iam binding thats needed
but if you wait ~60s and rerun the tests, it works
|
@danawillow think its ready now; |
I don't totally understand your most recent question, but any environment variable will be the same for all tests, and we often run tests in parallel. Does that answer the question? For the question around waiting, take a look at this test, which I think had the same problem: https://github.com/terraform-providers/terraform-provider-google/blob/master/google/provider_test.go#L477 |
thx, i'm what i meant by that is when i ran just the impersonation acc test locally, it would fail the first time but associate the IAM binding w/ the service accounts i specified in the env-var. If i ran the same test again, the test would pass since the binding was done a couple mins earlier. I believe this step does that per test run: that bit is what allows the following existing test to work
i guess what i'm trying to say is if the acc tests you're running now allows the test above to run, the impersonation test i've got in this PR should also work (i.,e they both require the same iam settings). Could you rerun the acc tests?
|
@danawillow could you rerun the test and see if it passes? I'm not really doing anything different to bootstrap impersonated credentials than that existing test. |
Yup, it passes. I should have some time to do a final review later today or early tomorrow. |
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.
This all looks good! I've noticed that your PR description still says this is a prototype. Am I good to merge this into the provider? If so, can you please update the description?
done; updated description; thanks! :) |
I had to make a small change to the upstream one and I'm a bit nervous about merge conflicts, so I'm going to close this. The code will be merged in via GoogleCloudPlatform/magic-modules#3739. |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks! |
PR adds oidc token support for this provider.
see #5669
This pr is now complete and does has working testcases;