-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add label support to google_compute_snapshot #570
Conversation
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 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) | ||
} |
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.
- Call
d.Set("label_fingerprint", apiSnapshot.LabelFingerprint)
here - Extract line 141-153 into a private method call
updateSnapshotLabel
or something along those lines. - Reuse the
updateSnapshotLabel
for the create and update method.
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 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.
- Done.
- Done.
google/resource_compute_snapshot.go
Outdated
return fmt.Errorf("Eror when reading snapshot for label update: %s", err) | ||
} | ||
|
||
// HERE |
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.
Not sure why there is this HERE
comment
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.
oops!
* Add label support to google_compute_snapshot * Refactor operation polling code to use client directly
* Add label support to google_compute_snapshot * Refactor operation polling code to use client directly
<!-- This change is generated by MagicModules. --> /cc @chrisst
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! |
Add labels for some resource in #17.