Documentation ¶
Index ¶
- Constants
- Variables
- func AddNodeCondition(c runtimeclient.Client, node *corev1.Node, cond corev1.NodeCondition) error
- func ConfigureClusterWideProxy(c client.Client, gomegaArgs ...interface{})
- func CreateCAPIMachineSet(ctx context.Context, cl client.Client, params CAPIMachineSetParams) (*clusterv1.MachineSet, error)
- func CreateCoreCluster(ctx context.Context, cl client.Client, clusterName, infraClusterKind string) *clusterv1.Cluster
- func CreateMHC(c client.Client, params MachineHealthCheckParams) (*machinev1.MachineHealthCheck, error)
- func CreateMachineSet(c runtimeclient.Client, params MachineSetParams) (*machinev1.MachineSet, error)
- func DeleteCAPIMachineSets(ctx context.Context, cl client.Client, machineSets ...*clusterv1.MachineSet)
- func DeleteDaemonset(ctx context.Context, c client.Client, deployment *kappsapi.DaemonSet) error
- func DeleteDeployment(ctx context.Context, c client.Client, deployment *kappsapi.Deployment) error
- func DeleteMachineSets(client runtimeclient.Client, machineSets ...*machinev1.MachineSet) error
- func DeleteMachines(ctx context.Context, client runtimeclient.Client, ...) error
- func DeleteMutatingWebhookConfiguration(ctx context.Context, c client.Client, ...) error
- func DeleteObjects(ctx context.Context, cl runtimeclient.Client, objs ...runtimeclient.Object)
- func DeleteProxy(c client.Client, gomegaArgs ...interface{})
- func DeleteValidatingWebhookConfiguration(ctx context.Context, c client.Client, ...) error
- func DeployProxy(c client.Client, gomegaArgs ...interface{})
- func DeploymentHasContainer(deployment *kappsapi.Deployment, containerName string) bool
- func FilterCAPIMachinesInPhase(machines []*clusterv1.Machine, machinePhase string) []*clusterv1.Machine
- func FilterMachines(machines []*machinev1.Machine, phase string) []*machinev1.Machine
- func FilterReadyNodes(nodes []corev1.Node) []corev1.Node
- func FilterRunningMachines(machines []*machinev1.Machine) []*machinev1.Machine
- func FilterSchedulableNodes(nodes []corev1.Node) []corev1.Node
- func GetCAPIMachineSet(ctx context.Context, cl client.Client, name string) (*clusterv1.MachineSet, error)
- func GetCAPIMachines(ctx context.Context, cl client.Client, selectors ...*metav1.LabelSelector) ([]*clusterv1.Machine, error)
- func GetCAPIMachinesFromMachineSet(ctx context.Context, cl client.Client, machineSet *clusterv1.MachineSet) ([]*clusterv1.Machine, error)
- func GetCAPINodeForMachine(ctx context.Context, c runtimeclient.Client, m *clusterv1.Machine) (*corev1.Node, error)
- func GetClusterAutoscaler(client runtimeclient.Client, name string) (*caov1.ClusterAutoscaler, error)
- func GetContext() context.Context
- func GetControlPlaneHostAndPort(ctx context.Context, cl client.Client) (string, int32, error)
- func GetCredentialsFromCluster(oc *gatherer.CLI) ([]byte, []byte, string)
- func GetDaemonset(ctx context.Context, c client.Client, name, namespace string) (*kappsapi.DaemonSet, error)
- func GetDeployment(ctx context.Context, c client.Client, name, namespace string) (*kappsapi.Deployment, error)
- func GetInfrastructure(ctx context.Context, c runtimeclient.Client) (*configv1.Infrastructure, error)
- func GetLatestMachineFromMachineSet(ctx context.Context, client runtimeclient.Client, ...) (*machinev1.Machine, error)
- func GetMachine(c runtimeclient.Client, name string) (*machinev1.Machine, error)
- func GetMachineFromNode(client runtimeclient.Client, node *corev1.Node) (*machinev1.Machine, error)
- func GetMachineSet(ctx context.Context, client runtimeclient.Client, name string) (*machinev1.MachineSet, error)
- func GetMachineSets(client runtimeclient.Client, selectors ...*metav1.LabelSelector) ([]*machinev1.MachineSet, error)
- func GetMachines(ctx context.Context, client runtimeclient.Client, ...) ([]*machinev1.Machine, error)
- func GetMachinesFromMachineSet(ctx context.Context, client runtimeclient.Client, ...) ([]*machinev1.Machine, error)
- func GetMutatingWebhookConfiguration(ctx context.Context, c client.Client, name string) (*admissionregistrationv1.MutatingWebhookConfiguration, error)
- func GetNodeForMachine(ctx context.Context, c runtimeclient.Client, m *machinev1.Machine) (*corev1.Node, error)
- func GetNodes(c runtimeclient.Client, selectors ...*metav1.LabelSelector) ([]corev1.Node, error)
- func GetNodesFromMachineSet(ctx context.Context, client runtimeclient.Client, ...) ([]*corev1.Node, error)
- func GetPlatform(ctx context.Context, c runtimeclient.Client) (configv1.PlatformType, error)
- func GetPods(client runtimeclient.Client, selector map[string]string) (*corev1.PodList, error)
- func GetReadyAndSchedulableNodes(c runtimeclient.Client) ([]corev1.Node, error)
- func GetService(ctx context.Context, c runtimeclient.Client, name, namespace string) (*corev1.Service, error)
- func GetServices(ctx context.Context, client runtimeclient.Client, selector map[string]string) (*corev1.ServiceList, error)
- func GetValidatingWebhookConfiguration(ctx context.Context, c client.Client, name string) (*admissionregistrationv1.ValidatingWebhookConfiguration, error)
- func GetWorkerMachineSets(ctx context.Context, client runtimeclient.Client) ([]*machinev1.MachineSet, error)
- func GetWorkerNodes(c runtimeclient.Client) ([]corev1.Node, error)
- func IsDaemonsetAvailable(ctx context.Context, c client.Client, name, namespace string) bool
- func IsDeploymentAvailable(ctx context.Context, c client.Client, name, namespace string) bool
- func IsDeploymentSynced(ctx context.Context, c client.Client, dep *kappsapi.Deployment, ...) bool
- func IsMutatingWebhookConfigurationSynced(ctx context.Context, c client.Client) bool
- func IsNodeReady(node *corev1.Node) bool
- func IsNodeSchedulable(node *corev1.Node) bool
- func IsServiceAvailable(ctx context.Context, c runtimeclient.Client, name, namespace string) bool
- func IsValidatingWebhookConfigurationSynced(ctx context.Context, c client.Client) bool
- func LoadClient() (runtimeclient.Client, error)
- func LoadClientset() (*kubernetes.Clientset, error)
- func MachinesPresent(existingMachines []*machinev1.Machine, machines ...*machinev1.Machine) bool
- func NewCLI() (*gatherer.CLI, error)
- func NewGatherer() (*gatherer.StateGatherer, error)
- func NewMachineSet(clusterName, namespace, name string, selectorLabels map[string]string, ...) *machinev1.MachineSet
- func NewWorkLoad(njobs int32, memoryRequest resource.Quantity, workloadJobName string, ...) *batchv1.Job
- func NodesAreReady(nodes []*corev1.Node) bool
- func RunCheckUntil(ctx context.Context, ...) bool
- func RunPodOnNode(clientset *kubernetes.Clientset, node *corev1.Node, namespace string, ...) (*corev1.Pod, PodLastLogFunc, PodCleanupFunc, error)
- func ScaleMachineSet(name string, replicas int) error
- func SkipIfNotTechPreviewNoUpgrade(oc *gatherer.CLI, cl runtimeclient.Client)
- func UnconfigureClusterWideProxy(c client.Client, gomegaArgs ...interface{})
- func UpdateDaemonset(ctx context.Context, c client.Client, name, namespace string, ...) error
- func UpdateDeployment(ctx context.Context, c client.Client, name, namespace string, ...) error
- func UpdateMutatingWebhookConfiguration(ctx context.Context, c client.Client, ...) error
- func UpdateValidatingWebhookConfiguration(ctx context.Context, c client.Client, ...) error
- func VerifyNodeDraining(ctx context.Context, client runtimeclient.Client, ...) (string, error)
- func WaitForCAPIMachineSetsDeleted(ctx context.Context, cl client.Client, machineSets ...*clusterv1.MachineSet)
- func WaitForCAPIMachinesRunning(ctx context.Context, cl client.Client, name string)
- func WaitForEvent(ctx context.Context, c runtimeclient.Client, kind, name, reason string) error
- func WaitForMachineSet(ctx context.Context, c runtimeclient.Client, name string)
- func WaitForMachineSetsDeleted(ctx context.Context, c runtimeclient.Client, ...)
- func WaitForMachinesDeleted(c runtimeclient.Client, machines ...*machinev1.Machine)
- func WaitForSpotMachineSet(ctx context.Context, c runtimeclient.Client, name string) error
- func WaitForStatusAvailableMedium(ctx context.Context, client runtimeclient.Client, name string) bool
- func WaitForStatusAvailableOverLong(ctx context.Context, client runtimeclient.Client, name string) bool
- func WaitForStatusAvailableShort(ctx context.Context, client runtimeclient.Client, name string) bool
- func WaitForValidatingWebhook(ctx context.Context, client runtimeclient.Client, name string) bool
- func WaitUntilAllNodesAreReady(ctx context.Context, client runtimeclient.Client) error
- func WaitUntilAllRCPodsAreReady(ctx context.Context, client runtimeclient.Client, ...) error
- func WaitUntilNodeDoesNotExists(ctx context.Context, client runtimeclient.Client, nodeName string) error
- type AwsClient
- func (a *AwsClient) CancelCapacityReservation(capacityReservationID string) (bool, error)
- func (a *AwsClient) CreateCapacityReservation(instanceType string, instancePlatform string, availabilityZone string, ...) (string, error)
- func (a *AwsClient) CreatePlacementGroup(groupName string, strategy string, partitionCount ...int64) (string, error)
- func (a *AwsClient) DeletePlacementGroup(groupName string) (string, error)
- type AwsKmsClient
- type CAPIMachineSetParams
- type GomegaAssertions
- type MachineHealthCheckParams
- type MachineSetParams
- func BuildAlternativeMachineSetParams(machineSetParams MachineSetParams, platform configv1.PlatformType) ([]MachineSetParams, error)
- func BuildMachineSetParams(ctx context.Context, client runtimeclient.Client, replicas int) MachineSetParams
- func BuildPerArchMachineSetParamsList(ctx context.Context, client runtimeclient.Client, replicas int) []MachineSetParams
- type PodCleanupFunc
- type PodLastLogFunc
Constants ¶
const ( PollNodesReadyTimeout = 10 * time.Minute ClusterKey = "machine.openshift.io/cluster-api-cluster" MachineSetKey = "machine.openshift.io/cluster-api-machineset" MachineAPINamespace = "openshift-machine-api" ClusterAPINamespace = "openshift-cluster-api" GlobalInfrastuctureName = "cluster" WorkerNodeRoleLabel = "node-role.kubernetes.io/worker" RetryShort = 1 * time.Second RetryMedium = 5 * time.Second // DefaultMachineSetReplicas is the default number of replicas of a machineset // if MachineSet.Spec.Replicas field is set to nil. DefaultMachineSetReplicas = 0 MachinePhaseRunning = "Running" MachinePhaseFailed = "Failed" MachineRoleLabel = "machine.openshift.io/cluster-api-machine-role" MachineTypeLabel = "machine.openshift.io/cluster-api-machine-type" MachineAnnotationKey = "machine.openshift.io/machine" ClusterAPIActuatorPkgTaint = "cluster-api-actuator-pkg" )
Various constants used by E2E tests.
const ( Amd64 = "amd64" ArchLabel = "e2e.openshift.io/arch" ReasonKey = "machine.openshift.io/reason" ReasonE2E = "actuator-e2e" )
Variables ¶
var ( WaitShort = 1 * time.Minute WaitMedium = 3 * time.Minute WaitOverMedium = 5 * time.Minute WaitLong = 15 * time.Minute WaitOverLong = 30 * time.Minute )
var ( // LabelAutoscaler applies to tests related to the cluster autoscaler functionality. LabelAutoscaler = ginkgo.Label("autoscaler") // LabelCAPI applies to tests related to Cluster API (CAPI) functionality. LabelCAPI = ginkgo.Label("capi") // LabelCCM applies to tests related to the Cloud Controller Manager (CCM). LabelCCM = ginkgo.Label("ccm") // LabelDevOnly indicates that the test can run in dev account only. LabelDevOnly = ginkgo.Label("dev-only") // LabelDisruptive marks tests that are disruptive in nature and may affect cluster stability. LabelDisruptive = ginkgo.Label("disruptive") // LabelLEVEL0 indicates that the test is a basic or critical test, if failed then block release. LabelLEVEL0 = ginkgo.Label("LEVEL0") // LabelMachineApprover applies to tests for the machine approver functionality. LabelMachineApprover = ginkgo.Label("machine-approver") // LabelMachineHealthCheck applies to tests for Machine Health Checks (MHC) functionality. LabelMachineHealthCheck = ginkgo.Label("machine-health-check") // LabelMAPI applies to tests related to the Machine API (MAPI). LabelMAPI = ginkgo.Label("mapi") // LabelPeriodic marks tests that are meant to run periodically. LabelPeriodic = ginkgo.Label("periodic") // LabelQEOnly indicates that the test can run in qe account only. LabelQEOnly = ginkgo.Label("qe-only") )
var DefaultMutatingWebhookConfiguration = webhooks.NewMachineMutatingWebhookConfiguration()
DefaultMutatingWebhookConfiguration is a default mutating webhook configuration resource provided by MAO.
var DefaultValidatingWebhookConfiguration = webhooks.NewMachineValidatingWebhookConfiguration()
DefaultValidatingWebhookConfiguration is a default validating webhook configuration resource provided by MAO.
var ( // ErrMachineNotProvisionedInsufficientCloudCapacity is used when we detect that the machine is not being provisioned due to insufficient provider capacity. ErrMachineNotProvisionedInsufficientCloudCapacity = errors.New("machine creation failed due to insufficient cloud provider capacity") )
Functions ¶
func AddNodeCondition ¶
func AddNodeCondition(c runtimeclient.Client, node *corev1.Node, cond corev1.NodeCondition) error
AddNodeCondition adds a condition in the given Node's status.
func ConfigureClusterWideProxy ¶
ConfigureClusterWideProxy configures the Cluster-Wide Proxy to use the MITM Proxy.
func CreateCAPIMachineSet ¶
func CreateCAPIMachineSet(ctx context.Context, cl client.Client, params CAPIMachineSetParams) (*clusterv1.MachineSet, error)
CreateCAPIMachineSet creates a new MachineSet resource.
func CreateCoreCluster ¶
func CreateCoreCluster(ctx context.Context, cl client.Client, clusterName, infraClusterKind string) *clusterv1.Cluster
CreateCoreCluster creates a cluster with the given name and returns the cluster object.
func CreateMHC ¶
func CreateMHC(c client.Client, params MachineHealthCheckParams) (*machinev1.MachineHealthCheck, error)
CreateMHC creates a new MachineHealthCheck resource.
func CreateMachineSet ¶
func CreateMachineSet(c runtimeclient.Client, params MachineSetParams) (*machinev1.MachineSet, error)
CreateMachineSet creates a new MachineSet resource.
func DeleteCAPIMachineSets ¶
func DeleteCAPIMachineSets(ctx context.Context, cl client.Client, machineSets ...*clusterv1.MachineSet)
DeleteCAPIMachineSets deletes the specified machinesets and returns an error on failure.
func DeleteDaemonset ¶
DeleteDaemonset deletes the specified deployment.
func DeleteDeployment ¶
DeleteDeployment deletes the specified deployment.
func DeleteMachineSets ¶
func DeleteMachineSets(client runtimeclient.Client, machineSets ...*machinev1.MachineSet) error
DeleteMachineSets deletes the specified machinesets and returns an error on failure.
func DeleteMachines ¶
func DeleteMachines(ctx context.Context, client runtimeclient.Client, machines ...*machinev1.Machine) error
DeleteMachines deletes the specified machines and returns an error on failure.
func DeleteMutatingWebhookConfiguration ¶
func DeleteMutatingWebhookConfiguration(ctx context.Context, c client.Client, webhookConfiguraiton *admissionregistrationv1.MutatingWebhookConfiguration) error
DeleteMutatingWebhookConfiguration deletes the specified MutatingWebhookConfiguration object.
func DeleteObjects ¶
func DeleteObjects(ctx context.Context, cl runtimeclient.Client, objs ...runtimeclient.Object)
DeleteObjects deletes the objects in the given list.
func DeleteProxy ¶
DeleteProxy delete the MITM Proxy from the cluster.
func DeleteValidatingWebhookConfiguration ¶
func DeleteValidatingWebhookConfiguration(ctx context.Context, c client.Client, webhookConfiguraiton *admissionregistrationv1.ValidatingWebhookConfiguration) error
DeleteValidatingWebhookConfiguration deletes the specified ValidatingWebhookConfiguration object.
func DeployProxy ¶
DeployProxy deploys a MITM Proxy to the cluster.
func DeploymentHasContainer ¶
func DeploymentHasContainer(deployment *kappsapi.Deployment, containerName string) bool
DeploymentHasContainer returns true if the deployment has container with the specified name.
func FilterCAPIMachinesInPhase ¶
func FilterCAPIMachinesInPhase(machines []*clusterv1.Machine, machinePhase string) []*clusterv1.Machine
FilterCAPIMachinesInPhase returns a slice of only those Machines in the input that are in the selected phase.
func FilterMachines ¶
FilterMachines returns a slice of only those Machines in the input that are in the requested phase.
func FilterReadyNodes ¶
FilterReadyNodes filters the list of nodes and returns a list with ready nodes.
func FilterRunningMachines ¶
FilterRunningMachines returns a slice of only those Machines in the input that are in the "Running" phase.
func FilterSchedulableNodes ¶
FilterSchedulableNodes filters the list of nodes and returns a list with schedulable nodes.
func GetCAPIMachineSet ¶
func GetCAPIMachineSet(ctx context.Context, cl client.Client, name string) (*clusterv1.MachineSet, error)
GetCAPIMachineSet gets a machineset by its name from the default machine API namespace.
func GetCAPIMachines ¶
func GetCAPIMachines(ctx context.Context, cl client.Client, selectors ...*metav1.LabelSelector) ([]*clusterv1.Machine, error)
GetCAPIMachines gets a list of machines from the default cluster API namespace. Optionaly, labels may be used to constrain listed machinesets.
func GetCAPIMachinesFromMachineSet ¶
func GetCAPIMachinesFromMachineSet(ctx context.Context, cl client.Client, machineSet *clusterv1.MachineSet) ([]*clusterv1.Machine, error)
GetCAPIMachinesFromMachineSet returns an array of machines owned by a given machineSet.
func GetCAPINodeForMachine ¶
func GetCAPINodeForMachine(ctx context.Context, c runtimeclient.Client, m *clusterv1.Machine) (*corev1.Node, error)
GetCAPINodeForMachine retrieves the node backing the given Machine.
func GetClusterAutoscaler ¶
func GetClusterAutoscaler(client runtimeclient.Client, name string) (*caov1.ClusterAutoscaler, error)
GetClusterAutoscaler gets a ClusterAutoscaler by its name from the default machine API namespace.
func GetCredentialsFromCluster ¶
GetCredentialsFromCluster get credentials from cluster.
func GetDaemonset ¶
func GetDaemonset(ctx context.Context, c client.Client, name, namespace string) (*kappsapi.DaemonSet, error)
GetDaemonset gets deployment object by name and namespace.
func GetDeployment ¶
func GetDeployment(ctx context.Context, c client.Client, name, namespace string) (*kappsapi.Deployment, error)
GetDeployment gets deployment object by name and namespace.
func GetInfrastructure ¶
func GetInfrastructure(ctx context.Context, c runtimeclient.Client) (*configv1.Infrastructure, error)
GetInfrastructure fetches the global cluster infrastructure object.
func GetLatestMachineFromMachineSet ¶
func GetLatestMachineFromMachineSet(ctx context.Context, client runtimeclient.Client, machineSet *machinev1.MachineSet) (*machinev1.Machine, error)
GetLatestMachineFromMachineSet returns the new created machine by a given machineSet.
func GetMachine ¶
GetMachine get a machine by its name from the default machine API namespace.
func GetMachineFromNode ¶
GetMachineFromNode returns the Machine associated with the given node.
func GetMachineSet ¶
func GetMachineSet(ctx context.Context, client runtimeclient.Client, name string) (*machinev1.MachineSet, error)
GetMachineSet gets a machineset by its name from the default machine API namespace.
func GetMachineSets ¶
func GetMachineSets(client runtimeclient.Client, selectors ...*metav1.LabelSelector) ([]*machinev1.MachineSet, error)
GetMachineSets gets a list of machinesets from the default machine API namespace. Optionaly, labels may be used to constrain listed machinesets.
func GetMachines ¶
func GetMachines(ctx context.Context, client runtimeclient.Client, selectors ...*metav1.LabelSelector) ([]*machinev1.Machine, error)
GetMachines gets a list of machinesets from the default machine API namespace. Optionaly, labels may be used to constrain listed machinesets.
func GetMachinesFromMachineSet ¶
func GetMachinesFromMachineSet(ctx context.Context, client runtimeclient.Client, machineSet *machinev1.MachineSet) ([]*machinev1.Machine, error)
GetMachinesFromMachineSet returns an array of machines owned by a given machineSet.
func GetMutatingWebhookConfiguration ¶
func GetMutatingWebhookConfiguration(ctx context.Context, c client.Client, name string) (*admissionregistrationv1.MutatingWebhookConfiguration, error)
GetMutatingWebhookConfiguration gets MutatingWebhookConfiguration object by name.
func GetNodeForMachine ¶
func GetNodeForMachine(ctx context.Context, c runtimeclient.Client, m *machinev1.Machine) (*corev1.Node, error)
GetNodeForMachine retrieves the node backing the given Machine.
func GetNodes ¶
func GetNodes(c runtimeclient.Client, selectors ...*metav1.LabelSelector) ([]corev1.Node, error)
GetNodes gets a list of nodes from a running cluster Optionaly, labels may be used to constrain listed nodes.
func GetNodesFromMachineSet ¶
func GetNodesFromMachineSet(ctx context.Context, client runtimeclient.Client, machineSet *machinev1.MachineSet) ([]*corev1.Node, error)
GetNodesFromMachineSet returns an array of nodes backed by machines owned by a given machineSet.
func GetPlatform ¶
func GetPlatform(ctx context.Context, c runtimeclient.Client) (configv1.PlatformType, error)
GetPlatform fetches the PlatformType from the infrastructure object. Caches value after first successful retrieval.
func GetReadyAndSchedulableNodes ¶
func GetReadyAndSchedulableNodes(c runtimeclient.Client) ([]corev1.Node, error)
GetReadyAndSchedulableNodes returns all the nodes that have the Ready condition and can schedule workloads.
func GetService ¶
func GetService(ctx context.Context, c runtimeclient.Client, name, namespace string) (*corev1.Service, error)
GetService gets service object by name and namespace.
func GetServices ¶
func GetServices(ctx context.Context, client runtimeclient.Client, selector map[string]string) (*corev1.ServiceList, error)
GetServices returns a list of services matching the provided selector.
func GetValidatingWebhookConfiguration ¶
func GetValidatingWebhookConfiguration(ctx context.Context, c client.Client, name string) (*admissionregistrationv1.ValidatingWebhookConfiguration, error)
GetValidatingWebhookConfiguration gets ValidatingWebhookConfiguration object by name.
func GetWorkerMachineSets ¶
func GetWorkerMachineSets(ctx context.Context, client runtimeclient.Client) ([]*machinev1.MachineSet, error)
GetWorkerMachineSets returns the MachineSets that label their Machines with the "worker" role.
func GetWorkerNodes ¶
func GetWorkerNodes(c runtimeclient.Client) ([]corev1.Node, error)
GetWorkerNodes returns all nodes with the nodeWorkerRoleLabel label.
func IsDaemonsetAvailable ¶
IsDaemonsetAvailable returns true if the deployment has one or more available replicas.
func IsDeploymentAvailable ¶
IsDeploymentAvailable returns true if the deployment has one or more available replicas.
func IsDeploymentSynced ¶
func IsDeploymentSynced(ctx context.Context, c client.Client, dep *kappsapi.Deployment, name, namespace string) bool
IsDeploymentSynced returns true if provided deployment spec matched one found on cluster.
func IsMutatingWebhookConfigurationSynced ¶
IsMutatingWebhookConfigurationSynced expects a matching MutatingWebhookConfiguration to be present in the cluster.
func IsNodeReady ¶
IsNodeReady returns true if the given node is ready.
func IsNodeSchedulable ¶
IsNodeSchedulable returns true is the given node can schedule workloads.
func IsServiceAvailable ¶
IsServiceAvailable returns true if the service exists.
func IsValidatingWebhookConfigurationSynced ¶
IsValidatingWebhookConfigurationSynced expects a matching MutatingWebhookConfiguration to be present in the cluster.
func LoadClient ¶
func LoadClient() (runtimeclient.Client, error)
LoadClient returns a new controller-runtime client.
func LoadClientset ¶
func LoadClientset() (*kubernetes.Clientset, error)
LoadClientset returns a new Kubernetes Clientset.
func MachinesPresent ¶
MachinesPresent search for each provided machine in `machines` argument in the predefined `existingMachines` list and returns true when all of them were found.
func NewCLI ¶
NewCLI initializes oc binary wrapper helper. Output and oc executable path configure depending on the environment. If Openshift CI is detected, respective parameters are set up.
func NewGatherer ¶
func NewGatherer() (*gatherer.StateGatherer, error)
NewGatherer initializes StateGatherer - helper for collection of MAPI-related resources and pod logs in tests.
func NewMachineSet ¶
func NewMachineSet( clusterName, namespace, name string, selectorLabels map[string]string, templateLabels map[string]string, providerSpec *machinev1.ProviderSpec, replicas int32, ) *machinev1.MachineSet
NewMachineSet returns a new MachineSet object.
func NewWorkLoad ¶
func NodesAreReady ¶
NodesAreReady returns true if an array of nodes are all ready.
func RunCheckUntil ¶
func RunCheckUntil(ctx context.Context, check, condition func(context.Context, GomegaAssertions) bool) bool
RunCheckUntil runs the check function until the condition succeeds or the context is cancelled. If the check fails before the condition succeeds, the test will fail. The check and condition functions must use the passed Gomega for any assertions so that we can handle failures within the functions appropriately.
func RunPodOnNode ¶
func RunPodOnNode(clientset *kubernetes.Clientset, node *corev1.Node, namespace string, podSpec corev1.PodSpec) (*corev1.Pod, PodLastLogFunc, PodCleanupFunc, error)
RunPodOnNode runs a pod according passed spec on particular node. returns created pod object, function for retrieve last logs, cleanup function and error if occurred.
func ScaleMachineSet ¶
ScaleMachineSet scales a machineSet with a given name to the given number of replicas.
func SkipIfNotTechPreviewNoUpgrade ¶
func SkipIfNotTechPreviewNoUpgrade(oc *gatherer.CLI, cl runtimeclient.Client)
SkipIfNotTechPreviewNoUpgrade skip test if a cluster is not a TechPreviewNoUpgrade cluster.
func UnconfigureClusterWideProxy ¶
UnconfigureClusterWideProxy configures the Cluster-Wide Proxy to stop using the MITM Proxy.
func UpdateDaemonset ¶
func UpdateDaemonset(ctx context.Context, c client.Client, name, namespace string, updated *kappsapi.DaemonSet) error
UpdateDaemonset updates the specified deployment.
func UpdateDeployment ¶
func UpdateDeployment(ctx context.Context, c client.Client, name, namespace string, updated *kappsapi.Deployment) error
UpdateDeployment updates the specified deployment.
func UpdateMutatingWebhookConfiguration ¶
func UpdateMutatingWebhookConfiguration(ctx context.Context, c client.Client, updated *admissionregistrationv1.MutatingWebhookConfiguration) error
UpdateMutatingWebhookConfiguration updates the specified mutating webhook configuration.
func UpdateValidatingWebhookConfiguration ¶
func UpdateValidatingWebhookConfiguration(ctx context.Context, c client.Client, updated *admissionregistrationv1.ValidatingWebhookConfiguration) error
UpdateValidatingWebhookConfiguration updates the specified mutating webhook configuration.
func VerifyNodeDraining ¶
func VerifyNodeDraining(ctx context.Context, client runtimeclient.Client, targetMachine *machinev1.Machine, rc *corev1.ReplicationController) (string, error)
func WaitForCAPIMachineSetsDeleted ¶
func WaitForCAPIMachineSetsDeleted(ctx context.Context, cl client.Client, machineSets ...*clusterv1.MachineSet)
WaitForCAPIMachineSetsDeleted polls until the given MachineSets are not found, and there are zero Machines found matching the MachineSet's label selector.
func WaitForCAPIMachinesRunning ¶
WaitForCAPIMachinesRunning waits for the all Machines belonging to the named MachineSet to enter the "Running" phase, and for all nodes belonging to those Machines to be ready.
func WaitForEvent ¶
WaitForEvent expects to find the given event.
func WaitForMachineSet ¶
func WaitForMachineSet(ctx context.Context, c runtimeclient.Client, name string)
WaitForMachineSet waits for the all Machines belonging to the named MachineSet to enter the "Running" phase, and for all nodes belonging to those Machines to be ready. If a Machine is detected in "Failed" phase, the test will exit early.
func WaitForMachineSetsDeleted ¶
func WaitForMachineSetsDeleted(ctx context.Context, c runtimeclient.Client, machineSets ...*machinev1.MachineSet)
WaitForMachineSetsDeleted polls until the given MachineSets are not found, and there are zero Machines found matching the MachineSet's label selector.
func WaitForMachinesDeleted ¶
func WaitForMachinesDeleted(c runtimeclient.Client, machines ...*machinev1.Machine)
WaitForMachinesDeleted polls until the given Machines are not found.
func WaitForSpotMachineSet ¶
WaitForSpotMachineSet waits for all Machines belonging to the machineSet to be running and their nodes to be ready. Unlike WaitForMachineSet, this function does not fail the test when machine cannoct be provisioned due to insufficient spot capacity.
func WaitUntilAllNodesAreReady ¶
func WaitUntilAllNodesAreReady(ctx context.Context, client runtimeclient.Client) error
WaitUntilAllNodesAreReady lists all nodes and waits until they are ready.
func WaitUntilAllRCPodsAreReady ¶
func WaitUntilAllRCPodsAreReady(ctx context.Context, client runtimeclient.Client, rc *corev1.ReplicationController) error
Types ¶
type AwsClient ¶
type AwsClient struct {
// contains filtered or unexported fields
}
AwsClient struct.
func NewAwsClient ¶
Init the aws client.
func (*AwsClient) CancelCapacityReservation ¶
CancelCapacityReservation Cancel a CapacityReservation.
func (*AwsClient) CreateCapacityReservation ¶
func (a *AwsClient) CreateCapacityReservation(instanceType string, instancePlatform string, availabilityZone string, instanceCount int64) (string, error)
CreateCapacityReservation Create CapacityReservation.
type AwsKmsClient ¶
type AwsKmsClient struct {
// contains filtered or unexported fields
}
AwsKmsClient struct.
func NewAwsKmsClient ¶
func NewAwsKmsClient(accessKeyID []byte, secureKey []byte, clusterRegion string) *AwsKmsClient
Init the aws kms client.
func (*AwsKmsClient) CreateKey ¶
func (akms *AwsKmsClient) CreateKey(description string) (string, error)
CreateKey create a key.
func (*AwsKmsClient) DeleteKey ¶
func (akms *AwsKmsClient) DeleteKey(key string) error
DeleteKey delete a key.
func (*AwsKmsClient) DescribeKeyByID ¶
func (akms *AwsKmsClient) DescribeKeyByID(kmsKeyID string) (string, error)
Describes aws customer managed kms key info.
type CAPIMachineSetParams ¶
type CAPIMachineSetParams struct {
// contains filtered or unexported fields
}
func NewCAPIMachineSetParams ¶
func NewCAPIMachineSetParams(msName, clusterName, failureDomain string, replicas int32, infrastructureRef corev1.ObjectReference) CAPIMachineSetParams
NewCAPIMachineSetParams returns a new CAPIMachineSetParams object.
func UpdateCAPIMachineSetName ¶
func UpdateCAPIMachineSetName(msName string, params CAPIMachineSetParams) CAPIMachineSetParams
UpdateCAPIMachineSetName returns CAPIMachineSetParams object with the updated machineset name.
type GomegaAssertions ¶
type GomegaAssertions interface { Ω(actual interface{}, extra ...interface{}) gomega.Assertion //nolint:asciicheck Expect(actual interface{}, extra ...interface{}) gomega.Assertion ExpectWithOffset(offset int, actual interface{}, extra ...interface{}) gomega.Assertion }
GomegaAssertions is a subset of the gomega.Gomega interface. It is the set allowed for checks and conditions in the RunCheckUntil helper function.
type MachineHealthCheckParams ¶
type MachineHealthCheckParams struct { Name string Labels map[string]string Conditions []machinev1.UnhealthyCondition MaxUnhealthy *int }
MachineHealthCheckParams represents the parameters for creating a new MachineHealthCheck resource for use in tests.
type MachineSetParams ¶
type MachineSetParams struct { Name string Replicas int32 Labels map[string]string Taints []corev1.Taint ProviderSpec *machinev1.ProviderSpec }
MachineSetParams represents the parameters for creating a new MachineSet resource for use in tests.
func BuildAlternativeMachineSetParams ¶
func BuildAlternativeMachineSetParams(machineSetParams MachineSetParams, platform configv1.PlatformType) ([]MachineSetParams, error)
BuildMachineSetParamsList creates a list of MachineSetParams based on the given machineSetParams with modified instance type.
func BuildMachineSetParams ¶
func BuildMachineSetParams(ctx context.Context, client runtimeclient.Client, replicas int) MachineSetParams
BuildMachineSetParams builds a MachineSetParams object from the first worker MachineSet retrieved from the cluster.
func BuildPerArchMachineSetParamsList ¶
func BuildPerArchMachineSetParamsList(ctx context.Context, client runtimeclient.Client, replicas int) []MachineSetParams
BuildPerArchMachineSetParamsList builds a list of MachineSetParams for each architecture in the cluster. Given a cluster with N machinesets, and M <= N total different architectures, this function will return M MachineSetParams.
type PodCleanupFunc ¶
type PodCleanupFunc func() error