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

Service account description uses patch for updates. #2650

Merged
merged 5 commits into from
Nov 12, 2019

Conversation

nat-henderson
Copy link
Contributor

Release Note Template for Downstream PRs (will be copied)

`compute`: mark `google_service_account.description` as ForceNew.

Fixes hashicorp/terraform-provider-google#4868.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 78b97f0.

Pull request statuses

No diff detected in terraform-google-conversion.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I built this PR into one or more new PRs on other repositories, and when those are closed, this PR will also be merged and closed.
depends: hashicorp/terraform-provider-google-beta#1362
depends: hashicorp/terraform-provider-google#4870

@kunzese
Copy link
Contributor

kunzese commented Nov 12, 2019

The service account description is also not updateable via the API Explorer.

Maybe because the update method is going to be deprecated?

Note: This method is in the process of being deprecated. Use serviceAccounts.patch instead.

Update 1:

It works via the gcloud cli:

$ gcloud iam service-accounts update testaccount@<project-id>.iam.gserviceaccount.com --description MyNewDescription
Updated serviceAccount [testaccount@<project-id>.iam.gserviceaccount.com].
description: MyNewDescription
name: projects/<project-id>/serviceAccounts/testaccount@<project-id>.iam.gserviceaccount.com
$ gcloud iam service-accounts describe testaccount@<project-id>.iam.gserviceaccount.com
description: MyNewDescription
email: testaccount@<project-id>.iam.gserviceaccount.com
etag: <snip>
name: projects/<project-id>/serviceAccounts/testaccount@<project-id>.iam.gserviceaccount.com
oauth2ClientId: '<snip>'
projectId: <project-id>
uniqueId: '<snip>'

Update 2:

If you create a new service account via terraform, the description field will be set correctly.

Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Was it your experience that https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/patch#google.iam.admin.v1.IAM.PatchServiceAccount didn't work? Update indicates that description is updatable as well.

If both don't work, can you file a bug against the service team? description clearly should be updatable.

@kunzese
Copy link
Contributor

kunzese commented Nov 12, 2019

@rileykarson only tried https://cloud.google.com/iam/docs/reference/rest/v1/projects.serviceAccounts/update with the API Explorer. I can test /patch tomorrow at work.

@nat-henderson
Copy link
Contributor Author

Ah, yep, patch works. I'll modify the CL.

@nat-henderson nat-henderson changed the title Service account description is not updateable. Service account description uses patch for updates. Nov 12, 2019
Copy link
Member

@rileykarson rileykarson left a comment

Choose a reason for hiding this comment

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

Can you use the same update method for both + add a test updating description?

@nat-henderson
Copy link
Contributor Author

Done, test passes.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 4734b61.

Pull request statuses

terraform-provider-google-beta already has an open PR.
No diff detected in terraform-google-conversion.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

@modular-magician
Copy link
Collaborator

Hi! I'm the modular magician, I work on Magic Modules.
I see that this PR has already had some downstream PRs generated. Any open downstreams are already updated to your most recent commit, 507d516.

Pull request statuses

terraform-provider-google-beta already has an open PR.
No diff detected in terraform-google-conversion.
terraform-provider-google already has an open PR.
No diff detected in Ansible.
No diff detected in Inspec.

New Pull Requests

I didn't open any new pull requests because of this PR.

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.

google_service_account description not properly updating
5 participants