config

package
v0.0.0-...-832fc54 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2026 License: MIT Imports: 48 Imported by: 0

Documentation

Index

Constants

View Source
const DEFAULT_VMSKU = "Standard_D2ds_v5"

Variables

View Source
var (
	// Config is populated before scenario goroutines start and is immutable after Initialize.
	Config                                                             = DefaultConfiguration()
	Azure                                                              *AzureClient
	VMIdentityName                                                     = "abe2e-vm-identity"
	VMSSHPublicKey, VMSSHPrivateKey, SysSSHPublicKey, SysSSHPrivateKey []byte
	VMSSHPrivateKeyFileName, SysSSHPrivateKeyFileName                  string
)
View Source
var (
	VHDUbuntu2204Gen2Arm64Containerd = &Image{
		Name:    "2204gen2arm64containerd",
		OS:      OSUbuntu,
		Arch:    "arm64",
		Distro:  datamodel.AKSUbuntuArm64Containerd2204Gen2,
		Gallery: &Config.GalleryLinux,
	}

	VHDUbuntu2204Gen2Containerd = &Image{
		Name:    "2204gen2containerd",
		OS:      OSUbuntu,
		Arch:    "amd64",
		Distro:  datamodel.AKSUbuntuContainerd2204Gen2,
		Gallery: &Config.GalleryLinux,
	}

	VHDUbuntu2204Gen2TLContainerd = &Image{
		Name:    "2204gen2TLcontainerd",
		OS:      OSUbuntu,
		Arch:    "amd64",
		Distro:  datamodel.AKSUbuntuContainerd2204TLGen2,
		Gallery: &Config.GalleryLinux,
	}

	VHDUbuntu2004FIPSGen2Containerd = &Image{
		Name:                  "2004gen2fipscontainerd",
		OS:                    OSUbuntu,
		Arch:                  "amd64",
		Distro:                datamodel.AKSUbuntuFipsContainerd2004Gen2,
		Gallery:               &Config.GalleryLinux,
		UnsupportedLocalDns:   true,
		SkipOldVHDValidations: true,
	}

	VHDUbuntu2204FIPSContainerd = &Image{
		Name:                "2204fipscontainerd",
		OS:                  OSUbuntu,
		Arch:                "amd64",
		Distro:              datamodel.AKSUbuntuFipsContainerd2204,
		Gallery:             &Config.GalleryLinux,
		UnsupportedLocalDns: true,
		UnsupportedGen2:     true,
	}

	VHDUbuntu2204Gen2FIPSContainerd = &Image{
		Name:                "2204gen2fipscontainerd",
		OS:                  OSUbuntu,
		Arch:                "amd64",
		Distro:              datamodel.AKSUbuntuFipsContainerd2204Gen2,
		Gallery:             &Config.GalleryLinux,
		UnsupportedLocalDns: true,
	}

	VHDUbuntu2204Gen2FIPSTLContainerd = &Image{
		Name:                "2204gen2fipsTLcontainerd",
		OS:                  OSUbuntu,
		Arch:                "amd64",
		Distro:              datamodel.AKSUbuntuFipsContainerd2204TLGen2,
		Gallery:             &Config.GalleryLinux,
		UnsupportedLocalDns: true,
	}

	VHDAzureLinuxV2Gen2 = &Image{
		Name:                  "V2gen2",
		OS:                    OSAzureLinux,
		Arch:                  "amd64",
		Distro:                datamodel.AKSAzureLinuxV2Gen2,
		Version:               datamodel.FrozenCBLMarinerV2AndAzureLinuxV2SIGImageVersion,
		Gallery:               &Config.GalleryLinux,
		SkipOldVHDValidations: true,
	}

	VHDAzureLinuxV3Gen2 = &Image{
		Name:    "AzureLinuxV3gen2",
		OS:      OSAzureLinux,
		Arch:    "amd64",
		Distro:  datamodel.AKSAzureLinuxV3Gen2,
		Gallery: &Config.GalleryLinux,
	}

	// VHDAzureLinuxV3Gen2Kata is the AzureLinux V3 Gen2 VHD built with FEATURE_FLAGS=kata.
	// The image definition name mirrors the SIG_IMAGE_NAME produced by the VHD builder for
	// OS_VERSION=V3kata + HYPERV_GENERATION=V2 (SKU_NAME=V3katagen2, prefixed with "AzureLinux").
	// See .pipelines/.vsts-vhd-builder-release.yaml (buildAzureLinuxV3gen2kata) and
	// vhdbuilder/packer/produce-packer-settings-functions.sh (ensure_sig_image_name_linux).
	VHDAzureLinuxV3Gen2Kata = &Image{
		Name:    "AzureLinuxV3katagen2",
		OS:      OSAzureLinux,
		Arch:    "amd64",
		Distro:  datamodel.AKSAzureLinuxV3Gen2Kata,
		Gallery: &Config.GalleryLinux,
	}

	VHDAzureLinuxV3Gen2FIPS = &Image{
		Name:                "AzureLinuxV3gen2fips",
		OS:                  OSAzureLinux,
		Arch:                "amd64",
		Distro:              datamodel.AKSAzureLinuxV3Gen2FIPS,
		Gallery:             &Config.GalleryLinux,
		UnsupportedLocalDns: true,
	}

	VHDUbuntu2404Gen1Containerd = &Image{
		Name:            "2404containerd",
		OS:              OSUbuntu,
		Arch:            "amd64",
		Distro:          datamodel.AKSUbuntuContainerd2404,
		Gallery:         &Config.GalleryLinux,
		UnsupportedGen2: true,
	}

	VHDUbuntu2404Gen2Containerd = &Image{
		Name:    "2404gen2containerd",
		OS:      OSUbuntu,
		Arch:    "amd64",
		Distro:  datamodel.AKSUbuntuContainerd2404Gen2,
		Gallery: &Config.GalleryLinux,
	}

	VHDUbuntu2404ArmContainerd = &Image{
		Name:    "2404gen2arm64containerd",
		OS:      OSUbuntu,
		Arch:    "arm64",
		Distro:  datamodel.AKSUbuntuArm64Containerd2404Gen2,
		Gallery: &Config.GalleryLinux,
	}

	VHDUbuntu2604MinimalGen2Containerd = &Image{
		Name:    "2604minimalgen2containerd",
		OS:      OSUbuntu,
		Arch:    "amd64",
		Distro:  datamodel.AKSUbuntuMinimalContainerd2604Gen2,
		Gallery: &Config.GalleryLinux,
	}

	VHDUbuntu2604MinimalArm64Gen2Containerd = &Image{
		Name:    "2604minimalgen2arm64containerd",
		OS:      OSUbuntu,
		Arch:    "arm64",
		Distro:  datamodel.AKSUbuntuMinimalArm64Containerd2604Gen2,
		Gallery: &Config.GalleryLinux,
	}

	VHDAzureLinuxV3Gen2Arm64 = &Image{
		Name:         "azurelinuxv3gen2arm64",
		OS:           OSAzureLinux,
		Arch:         "arm64",
		Distro:       datamodel.AKSAzureLinuxV3Arm64Gen2,
		Gallery:      &Config.GalleryLinux,
		OSDiskSizeGB: 60,
	}

	VHDACLGen2TL = &Image{
		Name:         "aclgen2TL",
		OS:           OSACL,
		Arch:         "amd64",
		Distro:       datamodel.AKSACLGen2TL,
		Gallery:      &Config.GalleryLinux,
		Flatcar:      true,
		OSDiskSizeGB: 60,
	}

	VHDACLArm64Gen2TL = &Image{
		Name:         "aclgen2arm64TL",
		OS:           OSACL,
		Arch:         "arm64",
		Distro:       datamodel.AKSACLArm64Gen2TL,
		Gallery:      &Config.GalleryLinux,
		Flatcar:      true,
		OSDiskSizeGB: 60,
	}

	VHDACLGen2FIPSTL = &Image{
		Name:                "aclgen2fipsTL",
		OS:                  OSACL,
		Arch:                "amd64",
		Distro:              datamodel.AKSACLGen2FIPSTL,
		Gallery:             &Config.GalleryLinux,
		Flatcar:             true,
		OSDiskSizeGB:        60,
		UnsupportedLocalDns: true,
	}

	VHDACLArm64Gen2FIPSTL = &Image{
		Name:                "aclgen2arm64fipsTL",
		OS:                  OSACL,
		Arch:                "arm64",
		Distro:              datamodel.AKSACLArm64Gen2FIPSTL,
		Gallery:             &Config.GalleryLinux,
		Flatcar:             true,
		OSDiskSizeGB:        60,
		UnsupportedLocalDns: true,
	}

	VHDWindows2022Containerd = &Image{
		Name:            "windows-2022-containerd",
		OS:              "windows",
		Arch:            "amd64",
		Distro:          datamodel.AKSWindows2022Containerd,
		Gallery:         &Config.GalleryWindows,
		UnsupportedGen2: true,
	}

	VHDWindows2022ContainerdGen2 = &Image{
		Name:    "windows-2022-containerd-gen2",
		OS:      OSWindows,
		Arch:    "amd64",
		Distro:  datamodel.AKSWindows2022ContainerdGen2,
		Gallery: &Config.GalleryWindows,
	}

	VHDWindows2025 = &Image{
		Name:            "windows-2025",
		OS:              OSWindows,
		Arch:            "amd64",
		Distro:          datamodel.AKSWindows2025,
		Gallery:         &Config.GalleryWindows,
		UnsupportedGen2: true,
	}

	VHDWindows2025Gen2 = &Image{
		Name:    "windows-2025-gen2",
		OS:      OSWindows,
		Arch:    "amd64",
		Distro:  datamodel.AKSWindows2025Gen2,
		Gallery: &Config.GalleryWindows,
	}

	VHDWindows2025Gen2TL = &Image{
		Name:    "windows-2025-gen2-tl",
		OS:      OSWindows,
		Arch:    "amd64",
		Distro:  datamodel.AKSWindows2025Gen2TL,
		Gallery: &Config.GalleryWindows,
	}
)
View Source
var ErrNotFound = fmt.Errorf("not found")

Functions

func DefaultRetryOpts

func DefaultRetryOpts() policy.RetryOptions

func Flags

func Flags() []cli.Flag

func GetPrivateACRName

func GetPrivateACRName(isNonAnonymousPull bool, location string) string

func Initialize

func Initialize() error

func LoadDotEnv

func LoadDotEnv() error

func NewHttpClient

func NewHttpClient() *http.Client

func PollUntilDoneOptions

func PollUntilDoneOptions() *runtime.PollUntilDoneOptions

PollUntilDoneOptions returns independent options for each ARM operation. The 15-second default avoids ARM throttling across concurrent scenarios.

func PrivateACRName

func PrivateACRName(location string) string

func PrivateACRNameNotAnon

func PrivateACRNameNotAnon(location string) string

func ResourceGroupName

func ResourceGroupName(location string) string

func SkuSupportsNVMe

func SkuSupportsNVMe(sku *armcompute.ResourceSKU) bool

SkuSupportsNVMe checks the DiskControllerTypes capability of a resource SKU. Returns true if supported disk controller type is NVMe.

func SkuSupportsOnlyGen2

func SkuSupportsOnlyGen2(sku *armcompute.ResourceSKU) bool

SkuSupportsOnlyGen2 checks the HyperVGenerations capability of a resource SKU. Returns true if the only supported hypervisor generation is V2.

Types

type AzureClient

type AzureClient struct {
	AKS                       *armcontainerservice.ManagedClustersClient
	AzureFirewall             *armnetwork.AzureFirewallsClient
	BastionHosts              *armnetwork.BastionHostsClient
	Blob                      *azblob.Client
	StorageContainers         *armstorage.BlobContainersClient
	CacheRulesClient          *armcontainerregistry.CacheRulesClient
	Core                      *azcore.Client
	Credential                *azidentity.AzureCLICredential
	Maintenance               *armcontainerservice.MaintenanceConfigurationsClient
	NetworkInterfaces         *armnetwork.InterfacesClient
	PrivateDNSZoneGroup       *armnetwork.PrivateDNSZoneGroupsClient
	PrivateEndpointClient     *armnetwork.PrivateEndpointsClient
	PrivateZonesClient        *armprivatedns.PrivateZonesClient
	RecordSetClient           *armprivatedns.RecordSetsClient
	RegistriesClient          *armcontainerregistry.RegistriesClient
	Resource                  *armresources.Client
	ResourceGroup             *armresources.ResourceGroupsClient
	Tags                      *armresources.TagsClient
	RoleAssignments           *armauthorization.RoleAssignmentsClient
	SecurityGroup             *armnetwork.SecurityGroupsClient
	StorageAccounts           *armstorage.AccountsClient
	Subnet                    *armnetwork.SubnetsClient
	PublicIPAddresses         *armnetwork.PublicIPAddressesClient
	Routes                    *armnetwork.RoutesClient
	RouteTables               *armnetwork.RouteTablesClient
	UserAssignedIdentities    *armmsi.UserAssignedIdentitiesClient
	VMSS                      *armcompute.VirtualMachineScaleSetsClient
	VMSSVM                    *armcompute.VirtualMachineScaleSetVMsClient
	VMs                       *armcompute.VirtualMachinesClient
	Images                    *armcompute.ImagesClient
	Snapshots                 *armcompute.SnapshotsClient
	Galleries                 *armcompute.GalleriesClient
	GalleryImages             *armcompute.GalleryImagesClient
	GalleryImageVersions      *armcompute.GalleryImageVersionsClient
	VNet                      *armnetwork.VirtualNetworksClient
	VirutalNetworkLinksClient *armprivatedns.VirtualNetworkLinksClient
	ArmOptions                *arm.ClientOptions
	VMSSVMRunCommands         *armcompute.VirtualMachineScaleSetVMRunCommandsClient
	VMExtensionImages         *armcompute.VirtualMachineExtensionImagesClient
	ResourceSKUs              *armcompute.ResourceSKUsClient
}

func NewAzureClient

func NewAzureClient() (*AzureClient, error)

func NewAzureClientForSubscription

func NewAzureClientForSubscription(subscriptionID string) (*AzureClient, error)

func (*AzureClient) CreateVMManagedIdentity

func (a *AzureClient) CreateVMManagedIdentity(ctx context.Context, identityLocation string) (string, error)

func (*AzureClient) CreateVMManagedIdentityInRG

func (a *AzureClient) CreateVMManagedIdentityInRG(ctx context.Context, resourceGroupName, location string) (string, error)

CreateVMManagedIdentityInRG creates a VM managed identity in the specified resource group without creating blob storage infrastructure (which belongs to the default subscription).

func (*AzureClient) DeleteDisk

func (a *AzureClient) DeleteDisk(ctx context.Context, resourceGroupName, diskName string) error

DeleteDisk deletes a managed disk

func (*AzureClient) DeleteSIGImageVersion

func (a *AzureClient) DeleteSIGImageVersion(ctx context.Context, galleryResourceGroup, galleryName, imageName, version string) error

DeleteSIGImageVersion deletes a SIG image version

func (*AzureClient) DeleteSnapshot

func (a *AzureClient) DeleteSnapshot(ctx context.Context, resourceGroupName, snapshotName string) error

DeleteSnapshot deletes a disk snapshot

func (*AzureClient) EnsureSIGImageVersion

func (a *AzureClient) EnsureSIGImageVersion(ctx context.Context, image *Image, location string) (VHDResourceID, error)

func (*AzureClient) GetLatestVMExtensionImageVersion

func (a *AzureClient) GetLatestVMExtensionImageVersion(ctx context.Context, location, extType, extPublisher string) (string, error)

GetLatestVMExtensionImageVersion lists VM extension images for a given extension name and returns the latest version. This is equivalent to: az vm extension image list -n Compute.AKS.Linux.AKSNode --latest

func (*AzureClient) IsVMSizeGen2Only

func (a *AzureClient) IsVMSizeGen2Only(ctx context.Context, location, vmSize string) (bool, error)

IsVMSizeGen2Only queries the Azure Resource SKUs API to determine if the given VM size only supports the Gen2 hypervisor (i.e., does not support Gen1).

func (*AzureClient) LatestSIGImageVersionByTag

func (a *AzureClient) LatestSIGImageVersionByTag(ctx context.Context, image *Image, tagName, tagValue, location string) (VHDResourceID, error)
func (a *AzureClient) UploadAndGetLink(ctx context.Context, blobName string, file *os.File) (string, error)

UploadAndGetLink uploads the data to the blob storage and returns the signed link to download the blob If the blob already exists, it will be overwritten

func (a *AzureClient) UploadAndGetSignedLink(ctx context.Context, blobName string, file *os.File) (string, error)

UploadAndGetSignedLink uploads the data to the blob storage and returns the signed link to download the blob If the blob already exists, it will be overwritten

func (*AzureClient) VMSizeSupportsNVMe

func (a *AzureClient) VMSizeSupportsNVMe(ctx context.Context, location, vmSize string) (bool, error)

VMSizeSupportsNVMe queries the Azure Resource SKUs API to determine if the given VM size supports the NVMe disk controller type.

type Configuration

type Configuration struct {
	ACRSecretName                          string
	AzureContainerRegistrytargetRepository string
	BlobContainer                          string
	BlobStorageAccountPrefix               string
	BuildID                                string
	DefaultLocation                        string
	DefaultPollInterval                    time.Duration
	DefaultSubnetName                      string
	DefaultVMSKU                           string
	Gen1SCSIVMSKU                          string
	MANAVMSKU                              string
	DisableScriptless                      bool
	DisableScriptLessCompilation           bool
	E2ELoggingDir                          string
	EnableSecureTLSBootstrapping           bool
	ExtendedTests                          string
	GalleryLinux                           Gallery
	GalleryWindows                         Gallery
	IgnoreScenariosWithMissingVHD          bool
	KeepVMSS                               bool
	NetworkIsolatedNSGName                 string
	Parallel                               int
	Retries                                int
	JUnitFile                              string
	OutputMode                             string
	SIGVersionTagName                      string
	SIGVersionTagValue                     string
	SkipTestsWithSKUCapacityIssue          bool
	SubscriptionID                         string
	SysSSHPublicKey                        string
	SysSSHPrivateKeyB64                    string
	TagsToRun                              string
	TagsToSkip                             string
	TestGalleryImagePrefix                 string
	TestGalleryNamePrefix                  string
	TestPreProvision                       bool
	TestTimeout                            time.Duration
	SuiteTimeout                           time.Duration
	VHDMetadataFile                        string
	// Must cover cluster-create AND bastion-create (run serially in prepareCluster, ~10-11m each).
	TestTimeoutCluster   time.Duration
	TestTimeoutVMSS      time.Duration
	WindowsAdminPassword string
	// contains filtered or unexported fields
}

func DefaultConfiguration

func DefaultConfiguration() *Configuration

func (*Configuration) BlobStorageAccount

func (c *Configuration) BlobStorageAccount() string

func (*Configuration) BlobStorageAccountURL

func (c *Configuration) BlobStorageAccountURL() string

func (*Configuration) IsLocalBuild

func (c *Configuration) IsLocalBuild() bool

func (*Configuration) String

func (c *Configuration) String() string

func (*Configuration) VMIdentityResourceID

func (c *Configuration) VMIdentityResourceID(location string) string

func (*Configuration) VMSKU

func (c *Configuration) VMSKU() string
type Gallery struct {
	SubscriptionID    string
	ResourceGroupName string
	Name              string
}

type Image

type Image struct {
	Arch                                string
	Distro                              datamodel.Distro
	Name                                string
	OS                                  OS
	Version                             string
	Gallery                             *Gallery
	UnsupportedKubeletNodeIP            bool
	UnsupportedLocalDns                 bool
	UnsupportedNVMe                     bool
	UnsupportedGen2                     bool
	IgnoreFailedCgroupTelemetryServices bool
	Flatcar                             bool
	SkipOldVHDValidations               bool
	// OSDiskSizeGB overrides the default OS disk size (50 GB) when set.
	OSDiskSizeGB int32
}

func GetRandomLinuxAMD64VHD

func GetRandomLinuxAMD64VHD() *Image

func (*Image) String

func (i *Image) String() string

func (*Image) SupportsScriptless

func (i *Image) SupportsScriptless() bool

type OS

type OS string
var (
	OSWindows    OS = "windows"
	OSUbuntu     OS = "ubuntu"
	OSMariner    OS = "mariner"
	OSAzureLinux OS = "azurelinux"
	OSFlatcar    OS = "flatcar"
	OSACL        OS = "azurecontainerlinux"
)

type VHDResourceID

type VHDResourceID string

VHDResourceID represents a resource ID pointing to a VHD in Azure. This could be theoretically be the resource ID of a managed image or SIG image version, though for now this will always be a SIG image version.

func GetVHDResourceID

func GetVHDResourceID(ctx context.Context, i Image, location string) (VHDResourceID, error)

func (VHDResourceID) Short

func (id VHDResourceID) Short() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL