From eb856ea0b829f6eb81d24b3c1196ca52cdbb11bf Mon Sep 17 00:00:00 2001 From: wangyueliang Date: Wed, 5 Jun 2024 17:12:41 +0800 Subject: [PATCH] Backport: Block unsupported kola run options [origInfo] backport from v0.13.0.x 9f9c4753 Block unsupported kola run options --- mantle/cmd/kola/kola.go | 2 +- mantle/cmd/kola/options.go | 112 ++++++++++++++++++------------------ mantle/cmd/kola/qemuexec.go | 2 +- mantle/cmd/kola/spawn.go | 2 +- mantle/cmd/kola/testiso.go | 2 +- 5 files changed, 60 insertions(+), 60 deletions(-) diff --git a/mantle/cmd/kola/kola.go b/mantle/cmd/kola/kola.go index 44341a12..25f11783 100644 --- a/mantle/cmd/kola/kola.go +++ b/mantle/cmd/kola/kola.go @@ -51,7 +51,7 @@ var ( root = &cobra.Command{ Use: "kola [command]", - Short: "The CoreOS Superdeep Borehole", + Short: "The NestOS Superdeep Borehole", // http://en.wikipedia.org/wiki/Kola_Superdeep_Borehole } diff --git a/mantle/cmd/kola/options.go b/mantle/cmd/kola/options.go index 9ba44f40..427b428f 100644 --- a/mantle/cmd/kola/options.go +++ b/mantle/cmd/kola/options.go @@ -26,7 +26,7 @@ import ( "github.com/coreos/stream-metadata-go/stream" "github.com/pkg/errors" - "github.com/coreos/coreos-assembler/mantle/auth" + // "github.com/coreos/coreos-assembler/mantle/auth" "github.com/coreos/coreos-assembler/mantle/fcos" "github.com/coreos/coreos-assembler/mantle/kola" "github.com/coreos/coreos-assembler/mantle/platform" @@ -65,9 +65,9 @@ func init() { ssv(&kola.Tags, "tag", []string{}, "Test tag to run. Can be specified multiple times.") sv(&kola.Sharding, "sharding", "", "Provide e.g. 'hash:m/n' where m and n are integers, 1 <= m <= n. Only tests hashing to m will be run.") bv(&kola.Options.SSHOnTestFailure, "ssh-on-test-failure", false, "SSH into a machine when tests fail") - sv(&kola.Options.Stream, "stream", "", "CoreOS stream ID (e.g. for Fedora CoreOS: stable, testing, next)") - sv(&kola.Options.CosaWorkdir, "workdir", "", "coreos-assembler working directory") - sv(&kola.Options.CosaBuildId, "build", "", "coreos-assembler build ID") + //sv(&kola.Options.Stream, "stream", "", "CoreOS stream ID (e.g. for Fedora CoreOS: stable, testing, next)") + sv(&kola.Options.CosaWorkdir, "workdir", "", "nestos-assembler working directory") + sv(&kola.Options.CosaBuildId, "build", "", "nestos-assembler build ID") sv(&kola.Options.CosaBuildArch, "arch", coreosarch.CurrentRpmArch(), "The target architecture of the build") sv(&kola.Options.AppendButane, "append-butane", "", "Path to Butane config which is merged with test code") sv(&kola.Options.AppendIgnition, "append-ignition", "", "Path to Ignition config which is merged with test code") @@ -77,55 +77,55 @@ func init() { sv(&kola.Options.OSContainer, "oscontainer", "", "oscontainer image pullspec for pivot (RHCOS only)") // aws-specific options - defaultRegion := os.Getenv("AWS_REGION") - if defaultRegion == "" { - // As everyone knows, this is the one, true region. Everything else is a mirage. - defaultRegion = "us-east-1" - } - sv(&kola.AWSOptions.CredentialsFile, "aws-credentials-file", "", "AWS credentials file (default \"~/.aws/credentials\")") - sv(&kola.AWSOptions.Region, "aws-region", defaultRegion, "AWS region") - sv(&kola.AWSOptions.Profile, "aws-profile", "default", "AWS profile name") - sv(&kola.AWSOptions.AMI, "aws-ami", "", `AWS AMI ID`) - // See https://github.com/openshift/installer/issues/2919 for example - sv(&kola.AWSOptions.InstanceType, "aws-type", "", "AWS instance type") - sv(&kola.AWSOptions.SecurityGroup, "aws-sg", "kola", "AWS security group name") - sv(&kola.AWSOptions.IAMInstanceProfile, "aws-iam-profile", "kola", "AWS IAM instance profile name") + // defaultRegion := os.Getenv("AWS_REGION") + // if defaultRegion == "" { + // // As everyone knows, this is the one, true region. Everything else is a mirage. + // defaultRegion = "us-east-1" + // } + // sv(&kola.AWSOptions.CredentialsFile, "aws-credentials-file", "", "AWS credentials file (default \"~/.aws/credentials\")") + // sv(&kola.AWSOptions.Region, "aws-region", defaultRegion, "AWS region") + // sv(&kola.AWSOptions.Profile, "aws-profile", "default", "AWS profile name") + // sv(&kola.AWSOptions.AMI, "aws-ami", "", `AWS AMI ID`) + // // See https://github.com/openshift/installer/issues/2919 for example + // sv(&kola.AWSOptions.InstanceType, "aws-type", "", "AWS instance type") + // 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.AzureCredentials, "azure-credentials", "", "Azure credentials file location (default \"~/"+auth.AzureCredentialsPath+"\")") - sv(&kola.AzureOptions.DiskURI, "azure-disk-uri", "", "Azure disk uri (custom images)") - sv(&kola.AzureOptions.Publisher, "azure-publisher", "CoreOS", "Azure image publisher (default \"CoreOS\"") - sv(&kola.AzureOptions.Offer, "azure-offer", "CoreOS", "Azure image offer (default \"CoreOS\"") - sv(&kola.AzureOptions.Sku, "azure-sku", "alpha", "Azure image sku/channel (default \"alpha\"") - sv(&kola.AzureOptions.Version, "azure-version", "", "Azure image version") - sv(&kola.AzureOptions.Location, "azure-location", "westus", "Azure location (default \"westus\"") - sv(&kola.AzureOptions.Size, "azure-size", "Standard_D2_v2", "Azure machine size (default \"Standard_D2_v2\")") + // sv(&kola.AzureOptions.AzureCredentials, "azure-credentials", "", "Azure credentials file location (default \"~/"+auth.AzureCredentialsPath+"\")") + // sv(&kola.AzureOptions.DiskURI, "azure-disk-uri", "", "Azure disk uri (custom images)") + // sv(&kola.AzureOptions.Publisher, "azure-publisher", "CoreOS", "Azure image publisher (default \"CoreOS\"") + // sv(&kola.AzureOptions.Offer, "azure-offer", "CoreOS", "Azure image offer (default \"CoreOS\"") + // sv(&kola.AzureOptions.Sku, "azure-sku", "alpha", "Azure image sku/channel (default \"alpha\"") + // sv(&kola.AzureOptions.Version, "azure-version", "", "Azure image version") + // sv(&kola.AzureOptions.Location, "azure-location", "westus", "Azure location (default \"westus\"") + // sv(&kola.AzureOptions.Size, "azure-size", "Standard_D2_v2", "Azure machine size (default \"Standard_D2_v2\")") // 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\")") - sv(&kola.DOOptions.AccessToken, "do-token", "", "DigitalOcean access token (overrides config file)") - sv(&kola.DOOptions.Region, "do-region", "sfo2", "DigitalOcean region slug") - sv(&kola.DOOptions.Size, "do-size", "1gb", "DigitalOcean size slug") - sv(&kola.DOOptions.Image, "do-image", "alpha", "DigitalOcean image ID, {alpha, beta, stable}, or user image name") + // sv(&kola.DOOptions.ConfigPath, "do-config-file", "", "DigitalOcean config file (default \"~/"+auth.DOConfigPath+"\")") + // sv(&kola.DOOptions.Profile, "do-profile", "", "DigitalOcean profile (default \"default\")") + // sv(&kola.DOOptions.AccessToken, "do-token", "", "DigitalOcean access token (overrides config file)") + // sv(&kola.DOOptions.Region, "do-region", "sfo2", "DigitalOcean region slug") + // sv(&kola.DOOptions.Size, "do-size", "1gb", "DigitalOcean size slug") + // sv(&kola.DOOptions.Image, "do-image", "alpha", "DigitalOcean image ID, {alpha, beta, stable}, or user image name") // esx-specific options - sv(&kola.ESXOptions.ConfigPath, "esx-config-file", "", "ESX config file (default \"~/"+auth.ESXConfigPath+"\")") - sv(&kola.ESXOptions.Server, "esx-server", "", "ESX server") - sv(&kola.ESXOptions.Profile, "esx-profile", "", "ESX profile (default \"default\")") - sv(&kola.ESXOptions.BaseVMName, "esx-base-vm", "", "ESX base VM name") + // sv(&kola.ESXOptions.ConfigPath, "esx-config-file", "", "ESX config file (default \"~/"+auth.ESXConfigPath+"\")") + // sv(&kola.ESXOptions.Server, "esx-server", "", "ESX server") + // sv(&kola.ESXOptions.Profile, "esx-profile", "", "ESX profile (default \"default\")") + // sv(&kola.ESXOptions.BaseVMName, "esx-base-vm", "", "ESX base VM name") // gcp-specific options - sv(&kola.GCPOptions.Image, "gcp-image", "", "GCP image, full api endpoints names are accepted if resource is in a different project") - sv(&kola.GCPOptions.Project, "gcp-project", "fedora-coreos-devel", "GCP project name") - sv(&kola.GCPOptions.Zone, "gcp-zone", "us-central1-a", "GCP zone name") - sv(&kola.GCPOptions.MachineType, "gcp-machinetype", "", "GCP machine type") - sv(&kola.GCPOptions.DiskType, "gcp-disktype", "pd-ssd", "GCP disk type") - sv(&kola.GCPOptions.Network, "gcp-network", "default", "GCP network") - sv(&kola.GCPOptions.ServiceAcct, "gcp-service-account", "", "GCP service account to attach to instance (default project default)") - bv(&kola.GCPOptions.ServiceAuth, "gcp-service-auth", false, "for non-interactive auth when running within GCP") - sv(&kola.GCPOptions.JSONKeyFile, "gcp-json-key", "", "use a service account's JSON key for authentication (default \"~/"+auth.GCPConfigPath+"\")") - bv(&kola.GCPOptions.Confidential, "gcp-confidential-vm", false, "create confidential instances") + // sv(&kola.GCPOptions.Image, "gcp-image", "", "GCP image, full api endpoints names are accepted if resource is in a different project") + // sv(&kola.GCPOptions.Project, "gcp-project", "fedora-coreos-devel", "GCP project name") + // sv(&kola.GCPOptions.Zone, "gcp-zone", "us-central1-a", "GCP zone name") + // sv(&kola.GCPOptions.MachineType, "gcp-machinetype", "", "GCP machine type") + // sv(&kola.GCPOptions.DiskType, "gcp-disktype", "pd-ssd", "GCP disk type") + // sv(&kola.GCPOptions.Network, "gcp-network", "default", "GCP network") + // sv(&kola.GCPOptions.ServiceAcct, "gcp-service-account", "", "GCP service account to attach to instance (default project default)") + // bv(&kola.GCPOptions.ServiceAuth, "gcp-service-auth", false, "for non-interactive auth when running within GCP") + // sv(&kola.GCPOptions.JSONKeyFile, "gcp-json-key", "", "use a service account's JSON key for authentication (default \"~/"+auth.GCPConfigPath+"\")") + // bv(&kola.GCPOptions.Confidential, "gcp-confidential-vm", false, "create confidential instances") // openstack-specific options sv(&kola.OpenStackOptions.ConfigPath, "openstack-config-file", "", "Path to a clouds.yaml formatted OpenStack config file. The underlying library defaults to ./clouds.yaml") @@ -138,19 +138,19 @@ func init() { sv(&kola.OpenStackOptions.FloatingIPNetwork, "openstack-floating-ip-network", "", "OpenStack network to use when creating a floating IP") // packet-specific options - sv(&kola.PacketOptions.ConfigPath, "packet-config-file", "", "Packet config file (default \"~/"+auth.PacketConfigPath+"\")") - sv(&kola.PacketOptions.Profile, "packet-profile", "", "Packet profile (default \"default\")") - sv(&kola.PacketOptions.ApiKey, "packet-api-key", "", "Packet API key (overrides config file)") - sv(&kola.PacketOptions.Project, "packet-project", "", "Packet project UUID (overrides config file)") - sv(&kola.PacketOptions.Facility, "packet-facility", "sjc1", "Packet facility code") - sv(&kola.PacketOptions.Plan, "packet-plan", "", "Packet plan slug (default arch-dependent, e.g. \"t1.small.x86\")") - sv(&kola.PacketOptions.Architecture, "packet-architecture", "x86_64", "Packet CPU architecture") - sv(&kola.PacketOptions.IPXEURL, "packet-ipxe-url", "", "iPXE script URL (default arch-dependent, e.g. \"https://raw.githubusercontent.com/coreos/coreos-assembler/main/mantle/platform/api/packet/fcos-x86_64.ipxe\")") - sv(&kola.PacketOptions.ImageURL, "packet-image-url", "", "image URL (default arch-dependent, e.g. \"https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/31.20200223.3.0/x86_64/fedora-coreos-31.20200223.3.0-metal.x86_64.raw.xz\")") + // sv(&kola.PacketOptions.ConfigPath, "packet-config-file", "", "Packet config file (default \"~/"+auth.PacketConfigPath+"\")") + // sv(&kola.PacketOptions.Profile, "packet-profile", "", "Packet profile (default \"default\")") + // sv(&kola.PacketOptions.ApiKey, "packet-api-key", "", "Packet API key (overrides config file)") + // sv(&kola.PacketOptions.Project, "packet-project", "", "Packet project UUID (overrides config file)") + // sv(&kola.PacketOptions.Facility, "packet-facility", "sjc1", "Packet facility code") + // sv(&kola.PacketOptions.Plan, "packet-plan", "", "Packet plan slug (default arch-dependent, e.g. \"t1.small.x86\")") + // sv(&kola.PacketOptions.Architecture, "packet-architecture", "x86_64", "Packet CPU architecture") + // sv(&kola.PacketOptions.IPXEURL, "packet-ipxe-url", "", "iPXE script URL (default arch-dependent, e.g. \"https://raw.githubusercontent.com/coreos/coreos-assembler/main/mantle/platform/api/packet/fcos-x86_64.ipxe\")") + // sv(&kola.PacketOptions.ImageURL, "packet-image-url", "", "image URL (default arch-dependent, e.g. \"https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/31.20200223.3.0/x86_64/fedora-coreos-31.20200223.3.0-metal.x86_64.raw.xz\")") // QEMU-specific options sv(&kola.QEMUOptions.Firmware, "qemu-firmware", "", "Boot firmware: bios,uefi,uefi-secure (default bios)") - sv(&kola.QEMUOptions.DiskImage, "qemu-image", "", "path to CoreOS disk image") + sv(&kola.QEMUOptions.DiskImage, "qemu-image", "", "path to NestOS disk image") sv(&kola.QEMUOptions.DiskSize, "qemu-size", "", "Resize target disk via qemu-img resize [+]SIZE") sv(&kola.QEMUOptions.DriveOpts, "qemu-drive-opts", "", "Arbitrary options to append to qemu -drive for primary disk") sv(&kola.QEMUOptions.Memory, "qemu-memory", "", "Default memory size in MB") @@ -161,7 +161,7 @@ func init() { bv(&kola.QEMUOptions.Swtpm, "qemu-swtpm", true, "Create temporary software TPM") ssv(&kola.QEMUOptions.BindRO, "qemu-bind-ro", nil, "Inject a host directory; this does not automatically mount in the guest") - sv(&kola.QEMUIsoOptions.IsoPath, "qemu-iso", "", "path to CoreOS ISO image") + sv(&kola.QEMUIsoOptions.IsoPath, "qemu-iso", "", "path to NestOS ISO image") bv(&kola.QEMUIsoOptions.AsDisk, "qemu-iso-as-disk", false, "attach ISO image as regular disk") // s390x secex specific options bv(&kola.QEMUOptions.SecureExecution, "qemu-secex", false, "Run IBM Secure Execution Image") diff --git a/mantle/cmd/kola/qemuexec.go b/mantle/cmd/kola/qemuexec.go index 93082545..873251be 100644 --- a/mantle/cmd/kola/qemuexec.go +++ b/mantle/cmd/kola/qemuexec.go @@ -36,7 +36,7 @@ var ( RunE: runQemuExec, PreRunE: preRun, Use: "qemuexec", - Short: "Directly execute qemu on a CoreOS instance", + Short: "Directly execute qemu on a NestOS instance", SilenceUsage: true, } diff --git a/mantle/cmd/kola/spawn.go b/mantle/cmd/kola/spawn.go index cd55d3d3..1eece356 100644 --- a/mantle/cmd/kola/spawn.go +++ b/mantle/cmd/kola/spawn.go @@ -40,7 +40,7 @@ var ( RunE: runSpawn, PreRunE: preRun, Use: "spawn", - Short: "spawn a CoreOS instance", + Short: "spawn a NestOS instance", SilenceUsage: true, } diff --git a/mantle/cmd/kola/testiso.go b/mantle/cmd/kola/testiso.go index 510c9c51..ed8c75a6 100644 --- a/mantle/cmd/kola/testiso.go +++ b/mantle/cmd/kola/testiso.go @@ -46,7 +46,7 @@ var ( RunE: runTestIso, PreRunE: preRun, Use: "testiso [glob pattern...]", - Short: "Test a CoreOS PXE boot or ISO install path", + Short: "Test a NestOS PXE boot or ISO install path", SilenceUsage: true, } -- Gitee