config

package
v0.0.0-...-0ea9430 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Config            = mustLoadConfig()
	Azure             = mustNewAzureClient()
	ResourceGroupName = "abe2e-" + Config.Location
	VMIdentityName    = "abe2e-vm-identity"
	PrivateACRName    = "privateacre2e" + Config.Location

	DefaultPollUntilDoneOptions = &runtime.PollUntilDoneOptions{
		Frequency: time.Second,
	}
)
View Source
var (
	VHDUbuntu1804Gen2Containerd = &Image{
		Name:   "1804gen2containerd",
		OS:     "ubuntu",
		Arch:   "amd64",
		Distro: datamodel.AKSUbuntuContainerd1804Gen2,
	}
	VHDUbuntu2204Gen2Arm64Containerd = &Image{
		Name:   "2204gen2arm64containerd",
		OS:     "ubuntu",
		Arch:   "arm64",
		Distro: datamodel.AKSUbuntuArm64Containerd2204Gen2,
	}
	VHDUbuntu2204Gen2Containerd = &Image{
		Name:   "2204gen2containerd",
		OS:     "ubuntu",
		Arch:   "amd64",
		Distro: datamodel.AKSUbuntuContainerd2404Gen2,
	}
	VHDAzureLinuxV2Gen2Arm64 = &Image{
		Name:   "AzureLinuxV2gen2arm64",
		OS:     "azurelinux",
		Arch:   "arm64",
		Distro: datamodel.AKSAzureLinuxV2Arm64Gen2,
	}
	VHDAzureLinuxV2Gen2 = &Image{
		Name:   "AzureLinuxV2gen2",
		OS:     "azurelinux",
		Arch:   "amd64",
		Distro: datamodel.AKSAzureLinuxV2Gen2,
	}
	VHDCBLMarinerV2Gen2Arm64 = &Image{
		Name:   "CBLMarinerV2gen2arm64",
		OS:     "mariner",
		Arch:   "arm64",
		Distro: datamodel.AKSCBLMarinerV2Arm64Gen2,
	}
	VHDCBLMarinerV2Gen2 = &Image{
		Name:   "CBLMarinerV2gen2",
		OS:     "mariner",
		Arch:   "amd64",
		Distro: datamodel.AKSCBLMarinerV2Gen2,
	}
	// this is a particular 2204gen2containerd image originally built with private packages,
	// if we ever want to update this then we'd need to run a new VHD build using private package overrides
	VHDUbuntu2204Gen2ContainerdPrivateKubePkg = &Image{

		Name:    "2204Gen2",
		OS:      "ubuntu",
		Arch:    "amd64",
		Version: "1.1704411049.2812",
		Distro:  datamodel.AKSUbuntuContainerd2404Gen2,
	}

	// without kubelet, kubectl, credential-provider and wasm
	VHDUbuntu2204Gen2ContainerdAirgapped = &Image{
		Name:    "2204Gen2",
		OS:      "ubuntu",
		Arch:    "amd64",
		Version: "1.1725612526.29638",
		Distro:  datamodel.AKSUbuntuContainerd2404Gen2,
	}
)
View Source
var ErrNotFound = fmt.Errorf("not found")

Functions

func DefaultRetryOpts

func DefaultRetryOpts() policy.RetryOptions

Types

type AzureClient

type AzureClient struct {
	AKS                       *armcontainerservice.ManagedClustersClient
	Blob                      *azblob.Client
	StorageContainers         *armstorage.BlobContainersClient
	CacheRulesClient          *armcontainerregistry.CacheRulesClient
	Core                      *azcore.Client
	Credential                *azidentity.DefaultAzureCredential
	GalleryImageVersion       *armcompute.GalleryImageVersionsClient
	Maintenance               *armcontainerservice.MaintenanceConfigurationsClient
	PrivateDNSZoneGroup       *armnetwork.PrivateDNSZoneGroupsClient
	PrivateEndpointClient     *armnetwork.PrivateEndpointsClient
	PrivateZonesClient        *armprivatedns.PrivateZonesClient
	RecordSetClient           *armprivatedns.RecordSetsClient
	RegistriesClient          *armcontainerregistry.RegistriesClient
	Resource                  *armresources.Client
	ResourceGroup             *armresources.ResourceGroupsClient
	RoleAssignments           *armauthorization.RoleAssignmentsClient
	SecurityGroup             *armnetwork.SecurityGroupsClient
	StorageAccounts           *armstorage.AccountsClient
	Subnet                    *armnetwork.SubnetsClient
	UserAssignedIdentities    *armmsi.UserAssignedIdentitiesClient
	VMSS                      *armcompute.VirtualMachineScaleSetsClient
	VMSSVM                    *armcompute.VirtualMachineScaleSetVMsClient
	VNet                      *armnetwork.VirtualNetworksClient
	VirutalNetworkLinksClient *armprivatedns.VirtualNetworkLinksClient
}

func NewAzureClient

func NewAzureClient() (*AzureClient, error)

func (*AzureClient) CreateVMManagedIdentity

func (a *AzureClient) CreateVMManagedIdentity(ctx context.Context) (string, 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

type Configuration

type Configuration struct {
	AirgapNSGName                 string        `env:"AIRGAP_NSG_NAME" envDefault:"abe2e-airgap-securityGroup" json:"airgapNSGName"`
	DefaultSubnetName             string        `env:"DEFAULT_SUBNET_NAME" envDefault:"aks-subnet" json:"defaultSubnetName"`
	BuildID                       string        `env:"BUILD_ID" envDefault:"local" json:"buildID"`
	Location                      string        `env:"LOCATION" envDefault:"westus3" json:"location"`
	SubscriptionID                string        `env:"SUBSCRIPTION_ID" envDefault:"8ecadfc9-d1a3-4ea4-b844-0d9f87e4d7c8" json:"subscriptionID"`
	GallerySubscriptionID         string        `env:"GALLERY_SUBSCRIPTION_ID" envDefault:"c4c3550e-a965-4993-a50c-628fd38cd3e1" json:"gallerySubscriptionID"`
	GalleryResourceGroupName      string        `env:"GALLERY_RESOURCE_GROUP_NAME" envDefault:"aksvhdtestbuildrg" json:"galleryResourceGroupName"`
	GalleryName                   string        `env:"GALLERY_NAME" envDefault:"PackerSigGalleryEastUS" json:"galleryName"`
	SIGVersionTagName             string        `env:"SIG_VERSION_TAG_NAME" envDefault:"branch" json:"sigVersionTagName"`
	SIGVersionTagValue            string        `env:"SIG_VERSION_TAG_VALUE" envDefault:"refs/heads/dev" json:"sigVersionTagValue"`
	TagsToRun                     string        `env:"TAGS_TO_RUN" json:"tagsToRun"`
	TagsToSkip                    string        `env:"TAGS_TO_SKIP" json:"tagsToSkip"`
	TestTimeout                   time.Duration `env:"TEST_TIMEOUT" envDefault:"35m" json:"testTimeout"`
	E2ELoggingDir                 string        `env:"LOGGING_DIR" envDefault:"scenario-logs" json:"e2eLoggingDir"`
	IgnoreScenariosWithMissingVHD bool          `env:"IGNORE_SCENARIOS_WITH_MISSING_VHD" json:"ignoreScenariosWithMissingVHD"`
	SkipTestsWithSKUCapacityIssue bool          `env:"SKIP_TESTS_WITH_SKU_CAPACITY_ISSUE" json:"skipTestsWithSKUCapacityIssue"`
	KeepVMSS                      bool          `env:"KEEP_VMSS" json:"keepVMSS"`
	BlobStorageAccountPrefix      string        `env:"BLOB_STORAGE_ACCOUNT_PREFIX" envDefault:"abe2e" json:"blobStorageAccountPrefix"`
	BlobContainer                 string        `env:"BLOB_CONTAINER" envDefault:"abe2e" json:"blobContainer"`
	EnableAKSNodeControllerTest   bool          `env:"ENABLE_AKS_NODE_CONTROLLER_TEST" json:"enableAKSNodeControllerTest"`
}

func (*Configuration) BlobStorageAccount

func (c *Configuration) BlobStorageAccount() string

func (*Configuration) BlobStorageAccountURL

func (c *Configuration) BlobStorageAccountURL() string

func (*Configuration) GalleryResourceID

func (c *Configuration) GalleryResourceID() string

func (Configuration) String

func (c Configuration) String() string

type Image

type Image struct {
	Arch    string
	Distro  datamodel.Distro
	Name    string
	OS      string
	Version string
	// contains filtered or unexported fields
}

func (*Image) String

func (i *Image) String() string

func (*Image) VHDResourceID

func (i *Image) VHDResourceID(ctx context.Context, t *testing.T) (VHDResourceID, error)

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 (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