Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/webhooks/machine_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ var (
return fmt.Sprintf("%s-rg", clusterID)
}
defaultAzureImageResourceID = func(clusterID string) string {
return fmt.Sprintf("/resourceGroups/%s/providers/Microsoft.Compute/images/%s", clusterID+"-rg", clusterID)
// image gallery names cannot have dashes
galleryName := strings.Replace(clusterID, "-", "_", -1)

return fmt.Sprintf("/resourceGroups/%s/providers/Microsoft.Compute/galleries/gallery_%s/images/%s/versions/%s", clusterID+"-rg", galleryName, clusterID, azureRHCOSVersion)
}
defaultAzureManagedIdentiy = func(clusterID string) string {
return fmt.Sprintf("%s-identity", clusterID)
Expand Down Expand Up @@ -132,6 +135,7 @@ const (
azureCachingTypeNone = "None"
azureCachingTypeReadOnly = "ReadOnly"
azureCachingTypeReadWrite = "ReadWrite"
azureRHCOSVersion = "latest" // The installer only sets up one version but its name may vary, using latest will pull it no matter the name.

// GCP Defaults
defaultGCPMachineType = "n1-standard-4"
Expand Down