-
Notifications
You must be signed in to change notification settings - Fork 80
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 Specialized Field for Shared Image Gallery Destination #295
Conversation
395ec52
to
f839fe0
Compare
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.
This looks good. Nicely done. One suggestion and one question. But otherwise good. Approving so you can merge when ready.
builder/azure/arm/config.go
Outdated
@@ -106,6 +106,8 @@ type SharedImageGalleryDestination struct { | |||
// Specify a storage account type for the Shared Image Gallery Image Version. | |||
// Defaults to `Standard_LRS`. Accepted values are `Standard_LRS`, `Standard_ZRS` and `Premium_LRS` | |||
SigDestinationStorageAccountType string `mapstructure:"storage_account_type"` | |||
// Set to true if publishing to a Specialized Gallery, this skips a call to set the resulting VM's OS state as Generalized | |||
SigDestinationSkipGeneralization bool `mapstructure:"skip_generalization"` |
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.
What do you think about calling this attribute specialized to match the Azure CLI flag?
The behavior is the same as it is written the only change is the name of the configuration attribute.
SigDestinationSkipGeneralization bool `mapstructure:"skip_generalization"` | |
SigDestinationSkipGeneralization bool `mapstructure:"specialized"` |
builder/azure/arm/config.go
Outdated
if c.SecureBootEnabled || c.VTpmEnabled { | ||
errs = packersdk.MultiErrorAppend(errs, fmt.Errorf("A managed image (managed_image_name, managed_image_resource_group_name) can not set SecureBoot or VTpm, these features are only supported when directly publishing to a Shared Image Gallery")) | ||
} | ||
if c.SharedGalleryDestination.SigDestinationSkipGeneralization { |
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.
NIce 👍
Co-authored-by: Wilken Rivera <dev@wilkenrivera.com>
8a53673
to
1617f4c
Compare
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.
LGTM
Adds specialized option to Shared Image Gallery Destination block, the plugin has previously always called Generalize which tells Azure to set the build virtual machine state to Generalized. Azure does not allow capturing Specialized VMs into managed images, so I've limited this to direct publish to Shared Image Gallery/Compute Gallery
https://learn.microsoft.com/en-us/azure/virtual-machines/vm-specialized-image-version
Closes #262
Example HCL template: