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 kubernetes_service_account data source #731

Merged
merged 4 commits into from
Apr 8, 2020
Merged

Add kubernetes_service_account data source #731

merged 4 commits into from
Apr 8, 2020

Conversation

andrein
Copy link
Contributor

@andrein andrein commented Jan 9, 2020

This PR adds support for the kubernetes service account datasource.

This datasource makes it easy to get the auto-generated secret token from service accounts not directly managed by terraform (in our setup, we need to access a secret token created by a helm chart)

@andrein
Copy link
Contributor Author

andrein commented Feb 12, 2020

Hi guys, can someone take a look at this PR?

@venky999
Copy link

can we have this PR merged.. very useful feature..

Copy link
Contributor

@dak1n1 dak1n1 left a comment

Choose a reason for hiding this comment

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

This looks really great! Thanks for putting this together. I left a bunch of comments, but mostly to make improvements that we don't have yet in other parts of the repo. It's something we're striving toward, and relating to an upcoming refactor too. But this PR is in really good shape overall, thanks!

website/docs/d/service_account.html.markdown Outdated Show resolved Hide resolved
website/docs/d/service_account.html.markdown Outdated Show resolved Hide resolved
website/docs/r/service_account.html.markdown Show resolved Hide resolved
kubernetes/data_source_kubernetes_service_account.go Outdated Show resolved Hide resolved
kubernetes/data_source_kubernetes_service_account.go Outdated Show resolved Hide resolved

data "kubernetes_secret" "example" {
metadata {
name = "${kubernetes_service_account.example.default_secret_name}"
Copy link
Contributor

Choose a reason for hiding this comment

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

In my testing, this was needed in order for terraform to apply it.

Suggested change
name = "${kubernetes_service_account.example.default_secret_name}"
name = "${data.kubernetes_service_account.example.default_secret_name}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Whoopsie, missed that one. I think I originally meant to use resource "kubernetes_service_account" "example". Shall I change that?

kubernetes/data_source_kubernetes_service_account.go Outdated Show resolved Hide resolved
kubernetes/provider.go Show resolved Hide resolved
website/docs/d/service_account.html.markdown Outdated Show resolved Hide resolved
@dak1n1 dak1n1 removed the request for review from alexsomesan April 7, 2020 17:31
@dak1n1 dak1n1 linked an issue Apr 7, 2020 that may be closed by this pull request
@andrein
Copy link
Contributor Author

andrein commented Apr 7, 2020

@dak1n1, thanks for the thorough review, I'll rebase and address the issues!

Andrei

@andrein andrein requested a review from dak1n1 April 7, 2020 23:49
Copy link
Contributor

@dak1n1 dak1n1 left a 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! Thanks for the quick response. The automated acceptance tests are passing for this branch, so we're ready to merge.

kubernetes/provider.go Show resolved Hide resolved
@dak1n1 dak1n1 merged commit e2a47b2 into hashicorp:master Apr 8, 2020
@dak1n1 dak1n1 mentioned this pull request Apr 9, 2020
@ghost
Copy link

ghost commented May 9, 2020

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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators May 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature Request: Service Account Data Source
4 participants