diff --git a/cmd/kola/kola.go b/cmd/kola/kola.go index ba409218e..f7ba87f39 100644 --- a/cmd/kola/kola.go +++ b/cmd/kola/kola.go @@ -135,6 +135,11 @@ func writeProps() error { AMI string `json:"ami"` InstanceType string `json:"type"` } + type Azure struct { + DiskURI string `json:"diskUri"` + Location string `json:"location"` + Size string `json:"size"` + } type DO struct { Region string `json:"region"` Size string `json:"size"` @@ -167,6 +172,7 @@ func writeProps() error { Platform string `json:"platform"` Board string `json:"board"` AWS AWS `json:"aws"` + Azure Azure `json:"azure"` DO DO `json:"do"` ESX ESX `json:"esx"` GCE GCE `json:"gce"` @@ -182,6 +188,11 @@ func writeProps() error { AMI: kola.AWSOptions.AMI, InstanceType: kola.AWSOptions.InstanceType, }, + Azure: Azure{ + DiskURI: kola.AzureOptions.DiskURI, + Location: kola.AzureOptions.Location, + Size: kola.AzureOptions.Size, + }, DO: DO{ Region: kola.DOOptions.Region, Size: kola.DOOptions.Size, diff --git a/cmd/kola/options.go b/cmd/kola/options.go index a571e16ec..d4752b0b5 100644 --- a/cmd/kola/options.go +++ b/cmd/kola/options.go @@ -28,7 +28,7 @@ var ( outputDir string kolaPlatform string defaultTargetBoard = sdk.DefaultBoard() - kolaPlatforms = []string{"aws", "do", "esx", "gce", "oci", "packet", "qemu"} + kolaPlatforms = []string{"aws", "azure", "do", "esx", "gce", "oci", "packet", "qemu"} kolaDefaultImages = map[string]string{ "amd64-usr": sdk.BuildRoot() + "/images/amd64-usr/latest/coreos_production_image.bin", "arm64-usr": sdk.BuildRoot() + "/images/arm64-usr/latest/coreos_production_image.bin", @@ -65,6 +65,11 @@ func init() { sv(&kola.AWSOptions.SecurityGroup, "aws-sg", "kola", "AWS security group name") sv(&kola.AWSOptions.IAMInstanceProfile, "aws-iam-profile", "kola", "AWS IAM instance profile name") + // azure-specific options + sv(&kola.AzureOptions.DiskURI, "azure-disk-uri", "", "Azure disk uri") + sv(&kola.AzureOptions.Location, "azure-location", "westus", "Azure location (default \"westus\"") + sv(&kola.AzureOptions.Size, "azure-size", "Standard_A1", "Azure machine size (default \"Standard_A1\")") + // do-specific options sv(&kola.DOOptions.ConfigPath, "do-config-file", "", "DigitalOcean config file (default \"~/"+auth.DOConfigPath+"\")") sv(&kola.DOOptions.Profile, "do-profile", "", "DigitalOcean profile (default \"default\")") diff --git a/kola/harness.go b/kola/harness.go index af43a0e2d..0a8748105 100644 --- a/kola/harness.go +++ b/kola/harness.go @@ -35,12 +35,14 @@ import ( "github.com/coreos/mantle/kola/torcx" "github.com/coreos/mantle/platform" awsapi "github.com/coreos/mantle/platform/api/aws" + azureapi "github.com/coreos/mantle/platform/api/azure" doapi "github.com/coreos/mantle/platform/api/do" esxapi "github.com/coreos/mantle/platform/api/esx" gcloudapi "github.com/coreos/mantle/platform/api/gcloud" ociapi "github.com/coreos/mantle/platform/api/oci" packetapi "github.com/coreos/mantle/platform/api/packet" "github.com/coreos/mantle/platform/machine/aws" + "github.com/coreos/mantle/platform/machine/azure" "github.com/coreos/mantle/platform/machine/do" "github.com/coreos/mantle/platform/machine/esx" "github.com/coreos/mantle/platform/machine/gcloud" @@ -55,6 +57,7 @@ var ( Options = platform.Options{} AWSOptions = awsapi.Options{Options: &Options} // glue to set platform options from main + AzureOptions = azureapi.Options{Options: &Options} // glue to set platform options from main DOOptions = doapi.Options{Options: &Options} // glue to set platform options from main ESXOptions = esxapi.Options{Options: &Options} // glue to set platform options from main GCEOptions = gcloudapi.Options{Options: &Options} // glue to set platform options from main @@ -126,6 +129,8 @@ func NewCluster(pltfrm string, rconf *platform.RuntimeConfig) (cluster platform. switch pltfrm { case "aws": cluster, err = aws.NewCluster(&AWSOptions, rconf) + case "azure": + cluster, err = azure.NewCluster(&AzureOptions, rconf) case "do": cluster, err = do.NewCluster(&DOOptions, rconf) case "esx":