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

Add "include_data_disks" option to control whether data disks are included in the image #142

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

Jalle19
Copy link

@Jalle19 Jalle19 commented Dec 3, 2024

Fixes #141

Enables e.g. the following use case:

// Use a data disk during baking but don't include it in the final image
include_data_disks = false
data_disks {
  disk_type = "CLOUD_BSSD"
  disk_size = 20
}

I could not find a way to correlate the data disks as returned by the API with our template data disk definitions, so it's difficult if not impossible to selectively exclude data disks from the image. While a global option is not the most flexible, it at least solves the problem where you have a single data disk that you don't want to include in the image.

This PR includes parts of #133 and #135 so it can be applied cleanly some day.

Since there is no way to correlate the disk IDs we get back from the DescribeInstances with the data disk definitions we have in our template, we can't selectively exclude data disks from the image. But at least this is better than nothing.
@Jalle19 Jalle19 requested a review from a team as a code owner December 3, 2024 09:22
"default" annotation has no effect, so we need to use a data type that supports "true/false/unset"
@Jalle19
Copy link
Author

Jalle19 commented Dec 5, 2024

Switched to using a Trilean so we can properly default to true

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for excluding data disks from the resulting image
1 participant