framework

package
v0.0.0-...-7f0811d Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: Apache-2.0 Imports: 90 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ClusterCreationTimeout      = 20 * time.Minute
	NodePoolCreationTimeout     = 20 * time.Minute
	ExternalAuthCreationTimeout = 15 * time.Minute
)

When updating timeouts, please refer to test/e2e/README.md for instructions. Provisioning timeouts

View Source
const (
	// BicepDeploymentScopeResourceGroup deploys into a specific resource group.
	BicepDeploymentScopeResourceGroup bicepDeploymentScope = iota
	// BicepDeploymentScopeSubscription deploys at subscription scope.
	BicepDeploymentScopeSubscription
)
View Source
const (
	RBACScopeResourceGroup RBACScope = "resourceGroup"
	RBACScopeResource      RBACScope = "resource"

	// Default OpenShift channel group and version for the E2E tests
	DefaultOCPChannelGroup         = "candidate"
	DefaultOCPVersionId            = "4.20"
	DefaultOCPNodePoolChannelGroup = "candidate"

	DefaultPodCIDR      = "10.128.0.0/14"
	DefaultServiceCIDR  = "172.30.0.0/16"
	DefaultK8sServiceIP = "172.30.0.1"
)
View Source
const (
	UsePooledIdentitiesEnvvar = "POOLED_IDENTITIES"
	LeasedMSIContainersEnvvar = "LEASED_MSI_CONTAINERS"
	E2ECustomRolePrefix       = "E2E-Test-CustomRole-"
)
View Source
const (
	ClusterApiAzureMiName        = "cluster-api-azure"
	ControlPlaneMiName           = "control-plane"
	CloudControllerManagerMiName = "cloud-controller-manager"
	IngressMiName                = "ingress"
	DiskCsiDriverMiName          = "disk-csi-driver"
	FileCsiDriverMiName          = "file-csi-driver"
	ImageRegistryMiName          = "image-registry"
	CloudNetworkConfigMiName     = "cloud-network-config"
	KmsMiName                    = "kms"
	DpDiskCsiDriverMiName        = "dp-disk-csi-driver"
	DpFileCsiDriverMiName        = "dp-file-csi-driver"
	DpImageRegistryMiName        = "dp-image-registry"
	ServiceManagedIdentityName   = "service"
)

well-known MSI role names

View Source
const (
	StandardPollInterval            = 10 * time.Second
	StandardResourceGroupExpiration = 4 * time.Hour
)
View Source
const ServiceManagedIdentityBuiltInRoleID = "c0ff367d-66d8-445e-917c-583feb0ef0d4"

Azure Red Hat OpenShift Hosted Control Planes Service Managed Identity built-in role

Variables

View Source
var (
	ErrNightlyReleaseStreamNotFound = errors.New("nightly release stream not found")
	ErrNoAcceptedNightlyTags        = errors.New("no accepted nightly tags found")
	ErrNoParseableNightlyTags       = errors.New("no parseable nightly tags found")
	ErrVersionNotFound              = errors.New("no graph nodes found")
)
View Source
var ErrNotEnoughFreeIdentityContainers = errors.New("not enough free identity containers")

ErrNotEnoughFreeIdentityContainers is returned when a reservation request asks for more identity containers than are currently free in the pool.

Functions

func AnnotatedLocation

func AnnotatedLocation(annotation string) types.CodeLocation

AnnotatedLocation can be used to provide more informative source code locations by passing the result as additional parameter to a BeforeEach/AfterEach/DeferCleanup/It/etc.

func AnnotatedLocationWithOffset

func AnnotatedLocationWithOffset(annotation string, offset int) types.CodeLocation

AnnotatedLocationWithOffset skips additional call stack levels. With 0 as offset it is identical to AnnotatedLocation.

func BeginCreateHCPCluster

func BeginCreateHCPCluster(
	ctx context.Context,
	logger logr.Logger,
	hcpClient *hcpsdk20240610preview.HcpOpenShiftClustersClient,
	resourceGroupName string,
	hcpClusterName string,
	clusterParams ClusterParams,
	location string,
) (*runtime.Poller[hcpsdk20240610preview.HcpOpenShiftClustersClientCreateOrUpdateResponse], error)

func BuildHCPCluster20251223FromParams

func BuildHCPCluster20251223FromParams(
	parameters ClusterParams,
	location string,
	imageDigestMirrors []*hcpsdk20251223preview.ImageDigestMirror,
) (hcpsdk20251223preview.HcpOpenShiftCluster, error)

func BuildHCPClusterFromParams

func BuildHCPClusterFromParams(
	parameters ClusterParams,
	location string,
) hcpsdk20240610preview.HcpOpenShiftCluster

func BuildNodePoolFromParams

func BuildNodePoolFromParams(
	parameters NodePoolParams,
	location string,
) hcpsdk20240610preview.NodePool

func CleanupAppRegistrations

func CleanupAppRegistrations(ctx context.Context, graphClient *graphutil.Client, appRegistrationIDs []string) error

func ConvertToManagedServiceIdentity

func ConvertToManagedServiceIdentity(value interface{}) (*hcpsdk20240610preview.ManagedServiceIdentity, error)

func ConvertToUserAssignedIdentitiesProfile

func ConvertToUserAssignedIdentitiesProfile(value interface{}) (*hcpsdk20240610preview.UserAssignedIdentitiesProfile, error)

func CreateClusterRoleBinding

func CreateClusterRoleBinding(ctx context.Context, subject string, adminRESTConfig *rest.Config) error

func CreateHCPCluster20251223AndWait

func CreateHCPCluster20251223AndWait(
	ctx context.Context,
	logger logr.Logger,
	hcpClient *hcpsdk20251223preview.HcpOpenShiftClustersClient,
	resourceGroupName string,
	hcpClusterName string,
	cluster hcpsdk20251223preview.HcpOpenShiftCluster,
	timeout time.Duration,
) (*hcpsdk20251223preview.HcpOpenShiftCluster, error)

CreateHCPCluster20251223AndWait creates an HCP cluster using the v20251223preview API and waits for completion.

func CreateHCPClusterAndWait

func CreateHCPClusterAndWait(
	ctx context.Context,
	logger logr.Logger,
	hcpClient *hcpsdk20240610preview.HcpOpenShiftClustersClient,
	resourceGroupName string,
	hcpClusterName string,
	cluster hcpsdk20240610preview.HcpOpenShiftCluster,
	timeout time.Duration,
) (*hcpsdk20240610preview.HcpOpenShiftCluster, error)

CreateHCPClusterAndWait Note that the timeout parameter will only take effect if its value is greater than 0. Otherwise, the function won't wait for the deployment to be ready.

func CreateNodePoolAndWait

func CreateNodePoolAndWait(
	ctx context.Context,
	nodePoolsClient *hcpsdk20240610preview.NodePoolsClient,
	resourceGroupName string,
	hcpClusterName string,
	nodePoolName string,
	nodePool hcpsdk20240610preview.NodePool,
	timeout time.Duration,
) (*hcpsdk20240610preview.NodePool, error)

func CreateNodePoolAndWait20251223

func CreateNodePoolAndWait20251223(
	ctx context.Context,
	nodePoolsClient *hcpsdk20251223preview.NodePoolsClient,
	resourceGroupName string,
	hcpClusterName string,
	nodePoolName string,
	nodePool hcpsdk20251223preview.NodePool,
	timeout time.Duration,
) (*hcpsdk20251223preview.NodePool, error)

CreateNodePoolAndWait20251223 creates a nodepool using the v20251223preview API and waits for completion.

func CreateOrUpdateExternalAuthAndWait

func CreateOrUpdateExternalAuthAndWait(
	ctx context.Context,
	externalAuthClient *hcpsdk20240610preview.ExternalAuthsClient,
	resourceGroupName string,
	hcpClusterName string,
	externalAuthName string,
	externalAuth hcpsdk20240610preview.ExternalAuth,
	timeout time.Duration,
) (*hcpsdk20240610preview.ExternalAuth, error)

CreateOrUpdateExternalAuthAndWait creates or updates an external auth on an HCP cluster and waits

func CreateResourceGroup

func CreateResourceGroup(
	ctx context.Context,
	resourceGroupsClient *armresources.ResourceGroupsClient,
	resourceGroupName string,
	location string,
	resourceGroupTTL time.Duration,
	timeout time.Duration,
) (*armresources.ResourceGroup, error)

CreateResourceGroup creates a resource group

func CreateTestDockerConfigSecret

func CreateTestDockerConfigSecret(host, username, password, email, secretName, namespace string) (*corev1.Secret, error)

CreateTestDockerConfigSecret creates a Docker config secret for testing pull secret functionality

func DefaultOpenshiftChannelGroup

func DefaultOpenshiftChannelGroup() string

func DefaultOpenshiftControlPlaneVersionId

func DefaultOpenshiftControlPlaneVersionId() string

func DefaultOpenshiftNodePoolChannelGroup

func DefaultOpenshiftNodePoolChannelGroup() string

func DefaultOpenshiftNodePoolVersionId

func DefaultOpenshiftNodePoolVersionId() string

func DeleteAllHCPClusters

func DeleteAllHCPClusters(
	ctx context.Context,
	hcpClient *hcpsdk20240610preview.HcpOpenShiftClustersClient,
	resourceGroupName string,
	timeout time.Duration,
) error

DeleteAllHCPClusters deletes all Clusters within a resource group and waits

func DeleteExternalAuthAndWait

func DeleteExternalAuthAndWait(
	ctx context.Context,
	externalAuthClient *hcpsdk20240610preview.ExternalAuthsClient,
	resourceGroupName string,
	hcpClusterName string,
	externalAuthName string,
	timeout time.Duration,
) error

DeleteExternalAuthAndWait deletes a an external auth on an HCP cluster and waits

func DeleteHCPCluster

func DeleteHCPCluster(
	ctx context.Context,
	hcpClient *hcpsdk20240610preview.HcpOpenShiftClustersClient,
	resourceGroupName string,
	hcpClusterName string,
	timeout time.Duration,
) error

DeleteHCPCluster deletes an hcp cluster and waits for the operation to complete

func DeleteNodePool

func DeleteNodePool(
	ctx context.Context,
	nodePoolsClient *hcpsdk20240610preview.NodePoolsClient,
	resourceGroupName string,
	hcpClusterName string,
	nodePoolName string,
	timeout time.Duration,
) error

DeleteNodePool deletes a nodepool and waits for the operation to complete

func DeleteResourceGroup

func DeleteResourceGroup(
	ctx context.Context,
	resourceGroupsClient *armresources.ResourceGroupsClient,
	networkClientFactory *armnetwork.ClientFactory,
	resourceGroupName string,
	force bool,
	timeout time.Duration,
) error

DeleteResourceGroup deletes a resource group and waits for the operation to complete

func GenerateKubeconfig

func GenerateKubeconfig(restConfig *rest.Config) (string, error)

Helper to generate kubeconfig

func GenerateSSHKeyPair

func GenerateSSHKeyPair() (publicKey string, privateKey string, err error)

Helper to generate SSH key pair

func GetAllVersionsInMinorStartingWith

func GetAllVersionsInMinorStartingWith(ctx context.Context, channelGroup string, version string) ([]semver.Version, error)

GetAllVersionsInMinorStartingWith returns all OpenShift versions in the same major.minor as the given version, including that version, from Cincinnati for the given channelGroup. The version string is parse-tolerant (e.g. "4.20", "4.20.0", "4.20.1"). Results are sorted descending (latest first).

func GetExternalAuth

func GetExternalAuth(
	ctx context.Context,
	externalAuthClient *hcpsdk20240610preview.ExternalAuthsClient,
	resourceGroupName string,
	hcpClusterName string,
	externalAuthName string,
) (hcpsdk20240610preview.ExternalAuthsClientGetResponse, error)

CreateExternalAuthAndWait creates a an external auth on an HCP cluster and waits

func GetHCPCluster

GetHCPCluster fetches an HCP cluster

func GetInstallVersionForZStreamUpgrade

func GetInstallVersionForZStreamUpgrade(ctx context.Context, channelGroup string, configuredVersionID string) (installVersion string, hasUpgradePath bool, err error)

GetInstallVersionForZStreamUpgrade returns the version to install the cluster with when testing a z-stream upgrade, and whether that version has an available z-stream upgrade path. It uses configuredVersionID and queries Cincinnati for the given channelGroup (e.g. "candidate", "stable"). When no version with an upgrade path is found, it still returns the configured version so the caller can install and optionally skip upgrade assertions.

func GetLatestInstallVersion

func GetLatestInstallVersion(ctx context.Context, channelGroup string, version string) (string, error)

GetLatestInstallVersion returns the latest install version for the given channel group and version For nightly channels, it returns the latest accepted nightly tag. For all other channels, it returns the latest version in the minor.

func GetLatestInstallVersionForGraphChannel

func GetLatestInstallVersionForGraphChannel(ctx context.Context, channelGroup string, version string) (string, error)

Note that this function is different from GetLatestVersionInMinor because it will return also engineering candidate versions.

func GetLatestInstallVersionForNightlyChannel

func GetLatestInstallVersionForNightlyChannel(version string) (string, error)

GetLatestInstallVersionForNightlyChannel returns the latest accepted nightly tag for the given minor version (for example "4.19" -> "4.19.0-0.nightly-multi-YYYY-MM-DD-HHMMSS").

func GetLatestVersionInMinor

func GetLatestVersionInMinor(ctx context.Context, channelGroup string, minorVersion string) (string, error)

GetLatestVersionInMinor returns the latest OpenShift version for the given major.minor (e.g. "4.20") from Cincinnati for the given channelGroup (e.g. "candidate", "stable").

func GetLatestVersionInMinorWithUpgradePathTo

func GetLatestVersionInMinorWithUpgradePathTo(ctx context.Context, channelGroup string, fromMinor string, toMinor string) (version string, hasUpgradePath bool, err error)

GetLatestVersionInMinorWithUpgradePathTo returns the latest OpenShift version for fromMinor (e.g. "4.20") that has a Cincinnati upgrade path to toMinor (e.g. "4.21"), for the given channelGroup. hasUpgradePath is false when no version in fromMinor has an upgrade path to toMinor.

func GetNodePool

func GetNodePool(
	ctx context.Context,
	nodePoolsClient *hcpsdk20240610preview.NodePoolsClient,
	resourceGroupName string,
	hcpClusterName string,
	nodePoolName string,
) (hcpsdk20240610preview.NodePoolsClientGetResponse, error)

GetNodePool fetches a nodepool resource

func GetNodePool20251223

func GetNodePool20251223(
	ctx context.Context,
	nodePoolsClient *hcpsdk20251223preview.NodePoolsClient,
	resourceGroupName string,
	hcpClusterName string,
	nodePoolName string,
) (*hcpsdk20251223preview.NodePool, error)

GetNodePool20251223 retrieves a nodepool using the v20251223preview API.

func GetOutputValue

func GetOutputValue(deploymentInfo *armresources.DeploymentExtended, outputName string) (interface{}, error)

func GetOutputValueBytes

func GetOutputValueBytes(deploymentInfo *armresources.DeploymentExtended, outputName string) ([]byte, error)

func GetOutputValueString

func GetOutputValueString(deploymentInfo *armresources.DeploymentExtended, outputName string) (string, error)

func GetSubscriptionID

func GetSubscriptionID(ctx context.Context, subscriptionClient *armsubscriptions.Client, subscriptionName string) (string, error)

func GetUpgradeCandidatesInMaxMinorFromCincinnati

func GetUpgradeCandidatesInMaxMinorFromCincinnati(ctx context.Context, channelGroup string, maxVersion string, fromVersion string) (candidates []semver.Version, err error)

GetUpgradeCandidatesInMaxMinorFromCincinnati returns all versions in the same major.minor as maxVersion that are <= maxVersion and have a Cincinnati upgrade path from fromVersion, for the given channelGroup. Results are sorted from lowest to highest. Use for possible upgrade targets (e.g. node pool y-stream upgrade).

func GetVirtualMachinesInResourceGroup

func GetVirtualMachinesInResourceGroup(
	ctx context.Context,
	computeClientFactory *armcompute.ClientFactory,
	resourceGroupName string,
	expectedMinimumCount int,
	timeout time.Duration,
) ([]*armcompute.VirtualMachine, error)

GetVirtualMachinesInResourceGroup lists all VMs in the given resource group with a polling loop to handle ARM replication delays.

func HasNodeLabel

func HasNodeLabel(nodes []corev1.Node, key, value string, expectedCount ...int) bool

func HasNodeTaint

func HasNodeTaint(nodes []corev1.Node, key, value string, effect corev1.TaintEffect, expectedCount ...int) bool

func InstallCiliumChart

func InstallCiliumChart(ctx context.Context, chartVersion string, values map[string]any, kubeconfigContent, ciliumNamespace string) error

Install Cilium helm chart using the helm Go SDK. Cilium configuration is passed via values argument.

func IsDevelopmentEnvironment

func IsDevelopmentEnvironment() bool

IsDevelopmentEnvironment indicates when this environment is development. This controls client endpoints and disables security when set to development.

func ListAllDeployments

func ListAllDeployments(
	ctx context.Context,
	deploymentsClient *armresources.DeploymentsClient,
	resourceGroupName string,
	timeout time.Duration,
) ([]*armresources.DeploymentExtended, error)

func ListAllExpiredResourceGroups

func ListAllExpiredResourceGroups(
	ctx context.Context,
	resourceGroupsClient *armresources.ResourceGroupsClient,
	now time.Time,
) ([]*armresources.ResourceGroup, error)

ListAllExpiredResourceGroups returns all expired e2e resource groups

func ListAllOperations

func ListAllOperations(
	ctx context.Context,
	deploymentOperationsClient *armresources.DeploymentOperationsClient,
	resourceGroupName string,
	deploymentName string,
	timeout time.Duration,
) ([]*armresources.DeploymentOperation, error)

func Must

func Must[T any](v T, err error) T

Must is a generic function that takes a value of type T and an error. If the error is not nil, it panics with the error. Otherwise, it returns the value of type T.

func NewLROPollerRetryDeploymentNotFoundPolicy

func NewLROPollerRetryDeploymentNotFoundPolicy() *lroPollerRetryDeploymentNotFoundPolicy

func NewTestContext

func NewTestContext() *perItOrDescribeTestContext

func NodePoolReleaseImages

func NodePoolReleaseImages(ctx context.Context, adminRESTConfig *rest.Config, nodePoolName string) (set.Set[string], error)

NodePoolReleaseImages returns release image refs from node.Status.Images for nodes in the given pool (lists nodes, then SelectNodesBelongingToNodePool). nodePoolName must be non-empty.

func RunVMCommand

func RunVMCommand(ctx context.Context, tc interface {
	SubscriptionID(ctx context.Context) (string, error)
	AzureCredential() (azcore.TokenCredential, error)
}, resourceGroup, vmName, command string, pollTimeout time.Duration) (string, error)

Helper to run command on VM

func SelectNodesBelongingToNodePool

func SelectNodesBelongingToNodePool(nodes []corev1.Node, nodePoolName string) ([]corev1.Node, error)

SelectNodesBelongingToNodePool groups nodes by the HyperShift node label (hypershift/v1beta1.NodePoolLabel).

HyperShift sets that label to "<HostedCluster prefix>-<nodePoolName>" (hyphen-separated), e.g. label "e2e-cluster-np-init-0" for customer node pool name "np-init-0". A node matches when the label value ends with "-<nodePoolName>" (the pool name is the final segment, not a prefix of the whole label).

A Kubernetes LabelSelector is not enough here: it only matches on the full label value (equality / set-based), not on a suffix or substring. Tests and callers typically know only the ARM node pool name, not the HostedCluster-specific prefix, so the complete label value is unknown until nodes are listed and inspected.

If several distinct label values match (e.g. one nodePoolName is a suffix of another pool’s name so both match HasSuffix), it returns the nodes for the label with the shortest length (tightest match). Under one HostedCluster the prefix is shared, so the real pool label is a single map key; same-length ties for different strings do not occur in that case.

nodePoolName must be non-empty (otherwise returns an error).

func SharedDir

func SharedDir() string

SharedDir is SHARED_DIR. It is a spot to store *files only* that can be shared between ci-operator steps. We can use this for anything, but currently we have a backup cleanup and collection scripts that use files here to cleanup and debug testing resources.

func SuffixName

func SuffixName(base, suffix string, maxLen int) string

SuffixName returns a name given a base ("deployment-5") and a suffix ("deploy") It will first attempt to join them with a dash. If the resulting name is longer than a valid pod name, it will truncate the base name and add an 8-character hash of the [base]-[suffix] string.

func UpdateHCPCluster

UpdateHCPCluster updates an HCP cluster using the v20240610preview SDK and waits for the operation to complete. Transient 500, 409, and CS state conflict 400 errors are retried automatically with exponential backoff.

func UpdateHCPCluster20251223

func UpdateHCPCluster20251223(
	ctx context.Context,
	hcpClient *hcpsdk20251223preview.HcpOpenShiftClustersClient,
	resourceGroupName string,
	hcpClusterName string,
	update hcpsdk20251223preview.HcpOpenShiftClusterUpdate,
	timeout time.Duration,
) (*hcpsdk20251223preview.HcpOpenShiftCluster, error)

UpdateHCPCluster20251223 updates an HCP cluster using the v20251223preview SDK and waits for the operation to complete. Transient 500 and 409 errors are retried automatically with exponential backoff.

func UpdateNodePoolAndWait

func UpdateNodePoolAndWait(
	ctx context.Context,
	nodePoolsClient *hcpsdk20240610preview.NodePoolsClient,
	resourceGroupName string,
	hcpClusterName string,
	nodePoolName string,
	update hcpsdk20240610preview.NodePoolUpdate,
	timeout time.Duration,
) (*hcpsdk20240610preview.NodePool, error)

UpdateNodePoolAndWait sends a PATCH (BeginUpdate) request for a nodepool and waits for completion within the provided timeout. It returns the final update response or an error.

func ValidateNodePoolDiskStorageAccountType

func ValidateNodePoolDiskStorageAccountType(
	ctx context.Context,
	nodePoolsClient *hcpsdk20240610preview.NodePoolsClient,
	resourceGroupName string,
	hcpClusterName string,
	nodePoolName string,
) error

Verifies that a nodepool created using framework has DiskStorageAccountType set to the framework default "StandardSSD_LRS"

Types

type AzureIdentityDetails

type AzureIdentityDetails struct {
	PrincipalName string
	PrincipalType PrincipalType
}

type BicepDeploymentOption

type BicepDeploymentOption func(*bicepDeploymentConfig)

func WithClusterResourceGroup

func WithClusterResourceGroup(resourceGroupName string) BicepDeploymentOption

func WithDebugDetailLevel

func WithDebugDetailLevel(level string) BicepDeploymentOption

func WithDeploymentName

func WithDeploymentName(name string) BicepDeploymentOption

func WithLocation

func WithLocation(location string) BicepDeploymentOption

func WithParameters

func WithParameters(parameters map[string]interface{}) BicepDeploymentOption

func WithScope

func WithScope(scope bicepDeploymentScope) BicepDeploymentOption

func WithTemplateFromBytes

func WithTemplateFromBytes(template []byte) BicepDeploymentOption

func WithTemplateFromFS

func WithTemplateFromFS(fs embed.FS, path string) BicepDeploymentOption

func WithTimeout

func WithTimeout(timeout time.Duration) BicepDeploymentOption

type CleanupFunc

type CleanupFunc func(ctx context.Context) error

type CleanupResourceGroupsOptions

type CleanupResourceGroupsOptions struct {
	ResourceGroupNames []string
	Timeout            time.Duration
	CleanupWorkflow    CleanupWorkflow
}

type CleanupWorkflow

type CleanupWorkflow string
const (
	CleanupWorkflowStandard CleanupWorkflow = "standard"
	CleanupWorkflowNoRP     CleanupWorkflow = "no-rp"
)

type ClusterParams

type ClusterParams struct {
	OpenshiftVersionId            string
	ClusterName                   string
	ManagedResourceGroupName      string
	NsgResourceID                 string
	NsgName                       string
	SubnetResourceID              string
	SubnetName                    string
	VnetName                      string
	UserAssignedIdentitiesProfile *hcpsdk20240610preview.UserAssignedIdentitiesProfile
	Identity                      *hcpsdk20240610preview.ManagedServiceIdentity
	KeyVaultName                  string
	EtcdEncryptionKeyName         string
	EtcdEncryptionKeyVersion      string
	EncryptionKeyManagementMode   string
	EncryptionType                string
	VnetIntegrationSubnetID       string
	KeyVaultVisibility            string
	Network                       NetworkConfig
	APIVisibility                 string
	ImageRegistryState            string
	ChannelGroup                  string
	AuthorizedCIDRs               []*string
	Autoscaling                   *hcpsdk20240610preview.ClusterAutoscalingProfile
	Tags                          map[string]*string
}

func NewDefaultClusterParams

func NewDefaultClusterParams() ClusterParams

func PopulateClusterParamsFromCustomerInfraDeployment

func PopulateClusterParamsFromCustomerInfraDeployment(
	params ClusterParams,
	customerInfraDeploymentResult *armresources.DeploymentExtended,
) (ClusterParams, error)

func PopulateClusterParamsFromManagedIdentitiesDeployment

func PopulateClusterParamsFromManagedIdentitiesDeployment(
	params ClusterParams,
	managedIdentitiesDeploymentResult *armresources.DeploymentExtended,
) (ClusterParams, error)

type ClusterVersionHistoryEntrySummary

type ClusterVersionHistoryEntrySummary struct {
	Version string `json:"version"`
	State   string `json:"state"`
	Image   string `json:"image"`
}

ClusterVersionHistoryEntrySummary is a compact view of one ClusterVersion status.history entry. Prefer SummarizeClusterVersionHistory over using raw []UpdateHistory where values are formatted for output (see SummarizeClusterVersionHistory).

func SummarizeClusterVersionHistory

func SummarizeClusterVersionHistory(history []configv1.UpdateHistory) []ClusterVersionHistoryEntrySummary

SummarizeClusterVersionHistory returns a representation of ClusterVersion status.history entries that omits *metav1.Time fields from configv1.UpdateHistory, avoiding nil pointer panics when the result is logged (for example CompletionTime is nil when state is "Partial") that the GinkgoLogr formatter would hit when logging raw history in test output.

type DockerConfigJSON

type DockerConfigJSON struct {
	Auths map[string]RegistryAuth `json:"auths"`
}

DockerConfigJSON is the root structure for dockerconfigjson secret data. See: https://kubernetes.io/docs/concepts/configuration/secret/#docker-config-secrets

type Identities

type Identities struct {
	ClusterApiAzureMiName        string `json:"clusterApiAzureMiName"`
	ControlPlaneMiName           string `json:"controlPlaneMiName"`
	CloudControllerManagerMiName string `json:"cloudControllerManagerMiName"`
	IngressMiName                string `json:"ingressMiName"`
	DiskCsiDriverMiName          string `json:"diskCsiDriverMiName"`
	FileCsiDriverMiName          string `json:"fileCsiDriverMiName"`
	ImageRegistryMiName          string `json:"imageRegistryMiName"`
	CloudNetworkConfigMiName     string `json:"cloudNetworkConfigMiName"`
	KmsMiName                    string `json:"kmsMiName"`
	DpDiskCsiDriverMiName        string `json:"dpDiskCsiDriverMiName"`
	DpFileCsiDriverMiName        string `json:"dpFileCsiDriverMiName"`
	DpImageRegistryMiName        string `json:"dpImageRegistryMiName"`
	ServiceManagedIdentityName   string `json:"serviceManagedIdentityName"`
}

func NewDefaultIdentities

func NewDefaultIdentities() Identities

func NewDefaultIdentitiesWithSuffix

func NewDefaultIdentitiesWithSuffix(suffix string) Identities

func (Identities) ToSlice

func (i Identities) ToSlice() []string

type IdentityRoleAssignments

type IdentityRoleAssignments struct {
	// RequiredActions is the complete list of all RBAC actions the identity needs
	// The validation will check if the built-in role provides these, and create a custom role
	// with any missing actions
	RequiredActions []string
}

IdentityRoleAssignments defines the expected role assignments for a managed identity.

func GetExpectedDefinitions

func GetExpectedDefinitions(identityType string) (*IdentityRoleAssignments, error)

GetExpectedDefinitions returns the expected permissions for a given identity type. The permissions are derived from roles defined in test/e2e-setup/bicep/modules/managed-identities.bicep These are the actual actions that the role grants, fetched from Azure role definitions.

The actions returned for build-in roles can deviate from the the ones that are actually present in Azure. This is legit and we use it at times where we need to test new permissions before the build-in role is rolled out to Azure.

type LeasedIdentityPool

type LeasedIdentityPool struct {
	ResourceGroupName string     `json:"resourceGroup"`
	Identities        Identities `json:"identities"`
}

type NetworkConfig

type NetworkConfig struct {
	NetworkType string
	PodCIDR     string
	ServiceCIDR string
	MachineCIDR string
	HostPrefix  int32
}

type NodePoolAutoScalingParams

type NodePoolAutoScalingParams struct {
	Min int32
	Max int32
}

NodePoolAutoScalingParams contains min/max node counts for nodepool autoscaling

type NodePoolParams

type NodePoolParams struct {
	OpenshiftVersionId     string
	ClusterName            string
	NodePoolName           string
	Replicas               int32
	VMSize                 string
	OSDiskSizeGiB          int32
	DiskStorageAccountType string
	ChannelGroup           string
	// NodeDrainTimeoutMinutes: how long (in minutes) to respect Pod Disruption Budgets when draining
	// nodes in this pool (e.g. upgrades, scale-in). Valid: 0 to 10080. 0 = no time limit for that phase.
	// When omitted from the create payload or nil here, the cluster-configured global nodeDrainTimeoutMinutes kicks in.
	NodeDrainTimeoutMinutes *int32
	// AutoScaling enables nodepool autoscaling. When set, Replicas is ignored.
	AutoScaling      *NodePoolAutoScalingParams
	AvailabilityZone string
}

func NewDefaultNodePoolParams

func NewDefaultNodePoolParams() NodePoolParams

type NonConformingClustersError

type NonConformingClustersError struct {
	// contains filtered or unexported fields
}

func (*NonConformingClustersError) Error

type PrincipalType

type PrincipalType string

PrincipalType represents the type of Azure AD principal.

const (
	PrincipalTypeDSTSUser            PrincipalType = "dstsUser"
	PrincipalTypeAADServicePrincipal PrincipalType = "aadServicePrincipal"
)

type RBACScope

type RBACScope string

type RegistryAuth

type RegistryAuth struct {
	Username string `json:"username,omitempty"`
	Email    string `json:"email,omitempty"`
	Auth     string `json:"auth"`
}

RegistryAuth represents authentication credentials for a single registry. This type models the structure of dockerconfigjson registry auth entries.

Jump to

Keyboard shortcuts

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