-
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
Always set instance template source images on read. #1916
Conversation
Previously, we were only setting source images for the disks in instance templates if they weren't set in the config. Instead, let's just always set them. This fixes our test failures about self_links not matching names. Also, relative links are safer than just image names, as Terraform wouldn't notice if another project's image of the same name got used instead of your project's. Also fix the setting of tags and tag fingerprints to always set, even if to the empty value, to fix the tests.
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.
If a user was previously using this resource and didn't have all their disks defined in their config, then they're going to see a diff immediately after upgrading. I'm fine with this, but we'll want a big warning in the changelog so we don't end up with another app engine fiasco.
I investigated when this would break things for users, and if it was worth keeping the old logic:
I think you're right, messaging in the CHANGELOG is probably the best way to address this. |
I'm happy with your analysis, but just wanted to point out that ^ is a thing we do all the time. |
I couldn't find an example--I looked in
and that felt like a lot of options to try and wrangle with backwards compatibility. If we have a way to do this, though, I'm game! |
Oh yeah with images it's more complicated, I was thinking just in general: https://github.com/terraform-providers/terraform-provider-google/blob/master/google/field_helpers.go |
Oh, fair. Honestly, I think the added complexity probably isn't worth preserving the broken behaviour, and advertising it in the changelog as a bug fix with a warning is probably the right way to go. I think you're in agreement, but do you mind just confirming/correcting? |
Confirmed! |
@danawillow Perhaps I'm confused, but I'm not sure how I'm supposed to work around this. I'm seeing a permadiff with this config:
Do we need to always specify the fully-qualified source image going forward? If so that seems decidedly suboptimal since |
That should not be the case. I agree this is suboptimal.
I think that's a bug, then. Let me investigate this, so we don't roll out the release without a fix for this. Update: this is a bug, fix incoming. |
I've opened #1995 to resolve this, but that is blocked by hashicorp/terraform#18795, unfortunately. I'll make sure we get a solution in before release, though. Thanks for catching this and reporting it before the release! |
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! |
Previously, we were only setting source images for the disks in instance
templates if they weren't set in the config. Instead, let's just always
set them. This fixes our test failures about self_links not matching
names. Also, relative links are safer than just image names, as
Terraform wouldn't notice if another project's image of the same name
got used instead of your project's.
Also fix the setting of tags and tag fingerprints to always set, even if
to the empty value, to fix the tests.