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

Fix pinning of machine_type #2 #172

Merged
merged 1 commit into from
Jan 9, 2025
Merged

Conversation

dimisjim
Copy link
Contributor

@dimisjim dimisjim commented Jan 9, 2025

continuation of: #149

what

Achieve pinning of COS image by fixing behavior of machine_image var and input to downstream container module

why

  • Be able to pin image and not always use latest one

references

Signed-off-by: dimisjim <[email protected]>
@dimisjim dimisjim requested a review from a team as a code owner January 9, 2025 11:07
@github-actions github-actions bot added the documentation Improvements or additions to documentation label Jan 9, 2025
Copy link
Member

@bschaatsbergen bschaatsbergen left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks a lot for your work on this pull request, and apologies for the delay in merging.

I do have a question regarding the format “To pin to one, use the following format: projects/cos-cloud/global/images/cos-stable-109-17800-147-54.” Is this different from the format we currently use when relying on the default behavior?

@dimisjim
Copy link
Contributor Author

dimisjim commented Jan 9, 2025

Thanks for the review!

Is this different from the format we currently use when relying on the default behavior?

I am not sure what you mean by this exactly.

What this PR does, is that it adds the possibility to pin the vm image to a particular one, so that terraform does not output any drift if a new one is released (they correspond to these OS versions and milestones of COS). This is done by setting the machine_image variable. If one does not set it, the previous behavior is retained. I am not aware of which format you are referring to.

@bschaatsbergen
Copy link
Member

bschaatsbergen commented Jan 9, 2025

Thanks for the review!

Is this different from the format we currently use when relying on the default behavior?

I am not sure what you mean by this exactly.

What this PR does, is that it adds the possibility to pin the vm image to a particular one, so that terraform does not output any drift if a new one is released (they correspond to these OS versions and milestones of COS). This is done by setting the machine_image variable. If one does not set it, the previous behavior is retained. I am not aware of which format you are referring to.

Thanks! I think I misinterpreted something while reading through the previous comments. LGTM! We’ll just need to test whether this is a breaking change. Could you check on this, @cblkwell, @DanielRieske, or @d-costa? I currently don’t have access to a Google Cloud project where I can roll this out.

After reviewing the source code of terraform-google-modules/container-vm/google, it seems that this simply sets an argument into an already executed data source. Therefore, I don’t expect this to be a breaking change. I’ll go ahead and merge it.

@bschaatsbergen bschaatsbergen merged commit e382de1 into runatlantis:main Jan 9, 2025
5 checks passed
@bschaatsbergen
Copy link
Member

Thank you for your contribution, @dimisjim 👏🏼! Apologies for the delay in getting this merged.

@bschaatsbergen bschaatsbergen added the patch A minor, backward compatible change label Jan 9, 2025
@dimisjim dimisjim deleted the patch-1 branch January 9, 2025 12:47
@bschaatsbergen
Copy link
Member

This has been released in v4.2.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation patch A minor, backward compatible change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instance being replaced even when the machine_image is pinned
2 participants