From 0f35c976a12a9dc78d691b9b1ef8274e760bed3c Mon Sep 17 00:00:00 2001 From: itsCheithanya <85927700+itsCheithanya@users.noreply.github.com> Date: Mon, 11 Mar 2024 22:53:42 +0530 Subject: [PATCH 1/2] Update options.go --- mantle/cmd/kola/options.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/mantle/cmd/kola/options.go b/mantle/cmd/kola/options.go index 82b61d4af9..d5de6546d3 100644 --- a/mantle/cmd/kola/options.go +++ b/mantle/cmd/kola/options.go @@ -179,6 +179,22 @@ func syncOptionsImpl(useCosa bool) error { } return fmt.Errorf("unsupported %v %q", name, item) } + switch { + case kola.AWSOptions.AMI!="": + kolaPlatform="aws" + case kola.AzureOptions.DiskURI!="": + kolaPlatform="azure" + case kola.DOOptions.Image: + kolaPlatform="do" + case kola.ESXOptions.BaseVMName: + kolaPlatform="esx" + case kola.GCPOptions.Image: + kolaPlatform="gcp" + case kola.OpenStackOptions.Image: + kolaPlatform="openstack" + case kola.PacketOptions.ImageURL: + kolaPlatform="packet" + } if kolaPlatform == "iso" { kolaPlatform = "qemu-iso" From 87c8ea47c9d15d85943e92a2be80daf0b38e2670 Mon Sep 17 00:00:00 2001 From: itsCheithanya <85927700+itsCheithanya@users.noreply.github.com> Date: Tue, 12 Mar 2024 23:35:44 +0530 Subject: [PATCH 2/2] Update options.go kola platform cmd logic processing --- mantle/cmd/kola/options.go | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/mantle/cmd/kola/options.go b/mantle/cmd/kola/options.go index d5de6546d3..696e7bcaad 100644 --- a/mantle/cmd/kola/options.go +++ b/mantle/cmd/kola/options.go @@ -179,22 +179,23 @@ func syncOptionsImpl(useCosa bool) error { } return fmt.Errorf("unsupported %v %q", name, item) } - switch { - case kola.AWSOptions.AMI!="": - kolaPlatform="aws" - case kola.AzureOptions.DiskURI!="": - kolaPlatform="azure" - case kola.DOOptions.Image: - kolaPlatform="do" - case kola.ESXOptions.BaseVMName: - kolaPlatform="esx" - case kola.GCPOptions.Image: - kolaPlatform="gcp" - case kola.OpenStackOptions.Image: - kolaPlatform="openstack" - case kola.PacketOptions.ImageURL: - kolaPlatform="packet" - } + + switch { + case kola.AWSOptions.CredentialsFile != "" || kola.AWSOptions.Region != "" || kola.AWSOptions.Profile != "" || kola.AWSOptions.AMI != "" || kola.AWSOptions.InstanceType != "" || kola.AWSOptions.SecurityGroup != "" || kola.AWSOptions.IAMInstanceProfile != "": + kolaPlatform = "aws" + case kola.AzureOptions.AzureCredentials != "" || kola.AzureOptions.DiskURI != "" || kola.AzureOptions.Publisher != "" || kola.AzureOptions.Offer != "" || kola.AzureOptions.Sku != "" || kola.AzureOptions.Version != "" || kola.AzureOptions.Location != "" || kola.AzureOptions.Size != "": + kolaPlatform = "azure" + case kola.DOOptions.ConfigPath != "" || kola.DOOptions.Profile != "" || kola.DOOptions.AccessToken != "" || kola.DOOptions.Region != "" || kola.DOOptions.Size != "" || kola.DOOptions.Image != "": + kolaPlatform = "do" + case kola.ESXOptions.ConfigPath != "" || kola.ESXOptions.Server != "" || kola.ESXOptions.Profile != "" || kola.ESXOptions.BaseVMName != "": + kolaPlatform = "esx" + case kola.GCPOptions.Image != "" || kola.GCPOptions.Project != "" || kola.GCPOptions.Zone != "" || kola.GCPOptions.MachineType != "" || kola.GCPOptions.DiskType != "" || kola.GCPOptions.Network != "" || kola.GCPOptions.ServiceAcct != "": + kolaPlatform = "gcp" + case kola.OpenStackOptions.ConfigPath != "" || kola.OpenStackOptions.Profile != "" || kola.OpenStackOptions.Region != "" || kola.OpenStackOptions.Image != "" || kola.OpenStackOptions.Flavor != "" || kola.OpenStackOptions.Network != "" || kola.OpenStackOptions.Domain != "" || kola.OpenStackOptions.FloatingIPNetwork != "": + kolaPlatform = "openstack" + case kola.PacketOptions.ConfigPath != "" || kola.PacketOptions.Profile != "" || kola.PacketOptions.ApiKey != "" || kola.PacketOptions.Project != "" || kola.PacketOptions.Facility != "" || kola.PacketOptions.Plan != "" || kola.PacketOptions.Architecture != "" || kola.PacketOptions.IPXEURL != "" || kola.PacketOptions.ImageURL != "": + kolaPlatform = "packet" + } if kolaPlatform == "iso" { kolaPlatform = "qemu-iso"