Documentation
¶
Index ¶
- Constants
- Variables
- func AnnotatedLocation(annotation string) types.CodeLocation
- func AnnotatedLocationWithOffset(annotation string, offset int) types.CodeLocation
- func BeginCreateHCPCluster(ctx context.Context, logger logr.Logger, ...) (...)
- func BuildHCPCluster20251223FromParams(parameters ClusterParams, location string, ...) (hcpsdk20251223preview.HcpOpenShiftCluster, error)
- func BuildHCPClusterFromParams(parameters ClusterParams, location string) hcpsdk20240610preview.HcpOpenShiftCluster
- func BuildNodePoolFromParams(parameters NodePoolParams, location string) hcpsdk20240610preview.NodePool
- func CleanupAppRegistrations(ctx context.Context, graphClient *graphutil.Client, ...) error
- func ConvertToManagedServiceIdentity(value interface{}) (*hcpsdk20240610preview.ManagedServiceIdentity, error)
- func ConvertToUserAssignedIdentitiesProfile(value interface{}) (*hcpsdk20240610preview.UserAssignedIdentitiesProfile, error)
- func CreateClusterRoleBinding(ctx context.Context, subject string, adminRESTConfig *rest.Config) error
- func CreateHCPCluster20251223AndWait(ctx context.Context, logger logr.Logger, ...) (*hcpsdk20251223preview.HcpOpenShiftCluster, error)
- func CreateHCPClusterAndWait(ctx context.Context, logger logr.Logger, ...) (*hcpsdk20240610preview.HcpOpenShiftCluster, error)
- func CreateNodePoolAndWait(ctx context.Context, nodePoolsClient *hcpsdk20240610preview.NodePoolsClient, ...) (*hcpsdk20240610preview.NodePool, error)
- func CreateNodePoolAndWait20251223(ctx context.Context, nodePoolsClient *hcpsdk20251223preview.NodePoolsClient, ...) (*hcpsdk20251223preview.NodePool, error)
- func CreateOrUpdateExternalAuthAndWait(ctx context.Context, ...) (*hcpsdk20240610preview.ExternalAuth, error)
- func CreateResourceGroup(ctx context.Context, resourceGroupsClient *armresources.ResourceGroupsClient, ...) (*armresources.ResourceGroup, error)
- func CreateTestDockerConfigSecret(host, username, password, email, secretName, namespace string) (*corev1.Secret, error)
- func DefaultOpenshiftChannelGroup() string
- func DefaultOpenshiftControlPlaneVersionId() string
- func DefaultOpenshiftNodePoolChannelGroup() string
- func DefaultOpenshiftNodePoolVersionId() string
- func DeleteAllHCPClusters(ctx context.Context, ...) error
- func DeleteExternalAuthAndWait(ctx context.Context, ...) error
- func DeleteHCPCluster(ctx context.Context, ...) error
- func DeleteNodePool(ctx context.Context, nodePoolsClient *hcpsdk20240610preview.NodePoolsClient, ...) error
- func DeleteResourceGroup(ctx context.Context, resourceGroupsClient *armresources.ResourceGroupsClient, ...) error
- func GenerateKubeconfig(restConfig *rest.Config) (string, error)
- func GenerateSSHKeyPair() (publicKey string, privateKey string, err error)
- func GetAllVersionsInMinorStartingWith(ctx context.Context, channelGroup string, version string) ([]semver.Version, error)
- func GetExternalAuth(ctx context.Context, ...) (hcpsdk20240610preview.ExternalAuthsClientGetResponse, error)
- func GetHCPCluster(ctx context.Context, ...) (hcpsdk20240610preview.HcpOpenShiftClustersClientGetResponse, error)
- func GetInstallVersionForZStreamUpgrade(ctx context.Context, channelGroup string, configuredVersionID string) (installVersion string, hasUpgradePath bool, err error)
- func GetLatestInstallVersion(ctx context.Context, channelGroup string, version string) (string, error)
- func GetLatestInstallVersionForGraphChannel(ctx context.Context, channelGroup string, version string) (string, error)
- func GetLatestInstallVersionForNightlyChannel(version string) (string, error)
- func GetLatestVersionInMinor(ctx context.Context, channelGroup string, minorVersion string) (string, error)
- func GetLatestVersionInMinorWithUpgradePathTo(ctx context.Context, channelGroup string, fromMinor string, toMinor string) (version string, hasUpgradePath bool, err error)
- func GetNodePool(ctx context.Context, nodePoolsClient *hcpsdk20240610preview.NodePoolsClient, ...) (hcpsdk20240610preview.NodePoolsClientGetResponse, error)
- func GetNodePool20251223(ctx context.Context, nodePoolsClient *hcpsdk20251223preview.NodePoolsClient, ...) (*hcpsdk20251223preview.NodePool, error)
- func GetOutputValue(deploymentInfo *armresources.DeploymentExtended, outputName string) (interface{}, error)
- func GetOutputValueBytes(deploymentInfo *armresources.DeploymentExtended, outputName string) ([]byte, error)
- func GetOutputValueString(deploymentInfo *armresources.DeploymentExtended, outputName string) (string, error)
- func GetSubscriptionID(ctx context.Context, subscriptionClient *armsubscriptions.Client, ...) (string, error)
- func GetUpgradeCandidatesInMaxMinorFromCincinnati(ctx context.Context, channelGroup string, maxVersion string, ...) (candidates []semver.Version, err error)
- func GetVirtualMachinesInResourceGroup(ctx context.Context, computeClientFactory *armcompute.ClientFactory, ...) ([]*armcompute.VirtualMachine, error)
- func HasNodeLabel(nodes []corev1.Node, key, value string, expectedCount ...int) bool
- func HasNodeTaint(nodes []corev1.Node, key, value string, effect corev1.TaintEffect, ...) bool
- func InstallCiliumChart(ctx context.Context, chartVersion string, values map[string]any, ...) error
- func IsDevelopmentEnvironment() bool
- func ListAllDeployments(ctx context.Context, deploymentsClient *armresources.DeploymentsClient, ...) ([]*armresources.DeploymentExtended, error)
- func ListAllExpiredResourceGroups(ctx context.Context, resourceGroupsClient *armresources.ResourceGroupsClient, ...) ([]*armresources.ResourceGroup, error)
- func ListAllOperations(ctx context.Context, ...) ([]*armresources.DeploymentOperation, error)
- func Must[T any](v T, err error) T
- func NewLROPollerRetryDeploymentNotFoundPolicy() *lroPollerRetryDeploymentNotFoundPolicy
- func NewTestContext() *perItOrDescribeTestContext
- func NodePoolReleaseImages(ctx context.Context, adminRESTConfig *rest.Config, nodePoolName string) (set.Set[string], error)
- func RunVMCommand(ctx context.Context, tc interface{ ... }, ...) (string, error)
- func SelectNodesBelongingToNodePool(nodes []corev1.Node, nodePoolName string) ([]corev1.Node, error)
- func SharedDir() string
- func SuffixName(base, suffix string, maxLen int) string
- func UpdateHCPCluster(ctx context.Context, ...) (*hcpsdk20240610preview.HcpOpenShiftCluster, error)
- func UpdateHCPCluster20251223(ctx context.Context, ...) (*hcpsdk20251223preview.HcpOpenShiftCluster, error)
- func UpdateNodePoolAndWait(ctx context.Context, nodePoolsClient *hcpsdk20240610preview.NodePoolsClient, ...) (*hcpsdk20240610preview.NodePool, error)
- func ValidateNodePoolDiskStorageAccountType(ctx context.Context, nodePoolsClient *hcpsdk20240610preview.NodePoolsClient, ...) error
- type AzureIdentityDetails
- type BicepDeploymentOption
- func WithClusterResourceGroup(resourceGroupName string) BicepDeploymentOption
- func WithDebugDetailLevel(level string) BicepDeploymentOption
- func WithDeploymentName(name string) BicepDeploymentOption
- func WithLocation(location string) BicepDeploymentOption
- func WithParameters(parameters map[string]interface{}) BicepDeploymentOption
- func WithScope(scope bicepDeploymentScope) BicepDeploymentOption
- func WithTemplateFromBytes(template []byte) BicepDeploymentOption
- func WithTemplateFromFS(fs embed.FS, path string) BicepDeploymentOption
- func WithTimeout(timeout time.Duration) BicepDeploymentOption
- type CleanupFunc
- type CleanupResourceGroupsOptions
- type CleanupWorkflow
- type ClusterParams
- type ClusterVersionHistoryEntrySummary
- type DockerConfigJSON
- type Identities
- type IdentityRoleAssignments
- type LeasedIdentityPool
- type NetworkConfig
- type NodePoolAutoScalingParams
- type NodePoolParams
- type NonConformingClustersError
- type PrincipalType
- type RBACScope
- type RegistryAuth
Constants ¶
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
const ( // BicepDeploymentScopeResourceGroup deploys into a specific resource group. BicepDeploymentScopeResourceGroup bicepDeploymentScope = iota // BicepDeploymentScopeSubscription deploys at subscription scope. BicepDeploymentScopeSubscription )
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" )
const ( UsePooledIdentitiesEnvvar = "POOLED_IDENTITIES" LeasedMSIContainersEnvvar = "LEASED_MSI_CONTAINERS" E2ECustomRolePrefix = "E2E-Test-CustomRole-" )
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
const ( StandardPollInterval = 10 * time.Second StandardResourceGroupExpiration = 4 * time.Hour )
const ServiceManagedIdentityBuiltInRoleID = "c0ff367d-66d8-445e-917c-583feb0ef0d4"
Azure Red Hat OpenShift Hosted Control Planes Service Managed Identity built-in role
Variables ¶
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") )
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 ConvertToManagedServiceIdentity ¶
func ConvertToManagedServiceIdentity(value interface{}) (*hcpsdk20240610preview.ManagedServiceIdentity, error)
func ConvertToUserAssignedIdentitiesProfile ¶
func ConvertToUserAssignedIdentitiesProfile(value interface{}) (*hcpsdk20240610preview.UserAssignedIdentitiesProfile, 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 ¶
Helper to generate kubeconfig
func GenerateSSHKeyPair ¶
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 ¶
func GetHCPCluster( ctx context.Context, hcpClient *hcpsdk20240610preview.HcpOpenShiftClustersClient, resourceGroupName string, hcpClusterName string, ) (hcpsdk20240610preview.HcpOpenShiftClustersClientGetResponse, error)
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 ¶
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 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 HasNodeTaint ¶
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 ¶
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 ¶
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 ¶
func UpdateHCPCluster( ctx context.Context, hcpClient *hcpsdk20240610preview.HcpOpenShiftClustersClient, resourceGroupName string, hcpClusterName string, update hcpsdk20240610preview.HcpOpenShiftClusterUpdate, timeout time.Duration, ) (*hcpsdk20240610preview.HcpOpenShiftCluster, error)
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 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 NodePoolAutoScalingParams ¶
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 ¶
func (e *NonConformingClustersError) Error() string
type PrincipalType ¶
type PrincipalType string
PrincipalType represents the type of Azure AD principal.
const ( PrincipalTypeDSTSUser PrincipalType = "dstsUser" PrincipalTypeAADServicePrincipal PrincipalType = "aadServicePrincipal" )
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.
Source Files
¶
- admin_api_helpers.go
- azure_client_policies.go
- cilium_helper.go
- cluster_version_history_summary.go
- constants.go
- deployment_helper.go
- deployment_operations.go
- deployment_params.go
- hcp_helper.go
- identities_helper.go
- nodes_helper.go
- per_invocation_framework.go
- per_test_framework.go
- pullsecret_types.go
- resourcegroup_helper.go
- version_helper.go