Skip to content

Add label support to google_compute_snapshot #570

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

Merged
merged 10 commits into from
Oct 13, 2017

Conversation

selmanj
Copy link
Contributor

@selmanj selmanj commented Oct 10, 2017

Add labels for some resource in #17.

Copy link
Contributor

@rosbo rosbo left a comment

Choose a reason for hiding this comment

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

I updated the PR description to reference #17.

apiSnapshot, err := config.clientCompute.Snapshots.Get(project, d.Id()).Do()
if err != nil {
return fmt.Errorf("Eror when reading snapshot for label update: %s", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Call d.Set("label_fingerprint", apiSnapshot.LabelFingerprint) here
  2. Extract line 141-153 into a private method call updateSnapshotLabel or something along those lines.
  3. Reuse the updateSnapshotLabel for the create and update method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. I don't know if it makes sense to set the fingerprint here, as this fingerprint is immediately out of date once the following set occurs. A read will occur later that puts the correct fingerprint value.
  2. Done.
  3. Done.

return fmt.Errorf("Eror when reading snapshot for label update: %s", err)
}

// HERE
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure why there is this HERE comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops!

@selmanj selmanj merged commit 2765290 into hashicorp:master Oct 13, 2017
negz pushed a commit to negz/terraform-provider-google that referenced this pull request Oct 17, 2017
* Add label support to google_compute_snapshot
* Refactor operation polling code to use client directly
chrisst pushed a commit to chrisst/terraform-provider-google that referenced this pull request Nov 9, 2018
* Add label support to google_compute_snapshot
* Refactor operation polling code to use client directly
luis-silva pushed a commit to luis-silva/terraform-provider-google that referenced this pull request May 21, 2019
<!-- This change is generated by MagicModules. -->
/cc @chrisst
@ghost
Copy link

ghost commented Mar 30, 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 Mar 30, 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.

2 participants