Skip to content

Commit 62d90f1

Browse files
committed
Add Image Type to Azure Machine Provider Spec
With Azure marketplace images, some images require that the subscription accept the terms of a purchase plan before using; and that purchase plan information must be included in Azure API calls when provisioning a VM. Images that do not require purchase plans must not submit purchase plan info. This adds an image type to distinguish between Marketplace images with or without purchase plans. It could be used in the future to support images from galleries.
1 parent 20da846 commit 62d90f1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

machine/v1beta1/types_azureprovider.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,28 @@ type Image struct {
174174
Version string `json:"version"`
175175
// ResourceID specifies an image to use by ID
176176
ResourceID string `json:"resourceID"`
177+
// Type identifies the source of the image and related information, such as purchase plans.
178+
// Valid values are "ID", "MarketplaceWithPlan", "MarketplaceNoPlan", and omitted, which
179+
// means no opinion and the platform chooses a good default which may change over time.
180+
// Currently that default is "MarketplaceNoPlan" if publisher data is supplied, or "ID" if not.
181+
// For more information about purchase plans, see:
182+
// https://docs.microsoft.com/en-us/azure/virtual-machines/linux/cli-ps-findimage#check-the-purchase-plan-information
183+
// +optional
184+
Type AzureImageType `json:"type,omitempty"`
177185
}
178186

187+
// AzureImageType provides an enumeration for the valid image types.
188+
type AzureImageType string
189+
190+
const (
191+
// AzureImageTypeID specifies that the image should be referenced by its resource ID.
192+
AzureImageTypeID AzureImageType = "ID"
193+
// AzureImageTypeMarketplaceNoPlan are images available from the marketplace that do not require a purchase plan.
194+
AzureImageTypeMarketplaceNoPlan AzureImageType = "MarketplaceNoPlan"
195+
// AzureImageTypeMarketplaceWithPlan require a purchase plan. Upstream these images are referred to as "ThirdParty."
196+
AzureImageTypeMarketplaceWithPlan AzureImageType = "MarketplaceWithPlan"
197+
)
198+
179199
type OSDisk struct {
180200
// OSType is the operating system type of the OS disk. Possible values include "Linux" and "Windows".
181201
OSType string `json:"osType"`

machine/v1beta1/zz_generated.swagger_doc_generated.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)