helpers

package
v0.0.0-...-2b86969 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckControlPlaneMachineOnDeleteReplacement

func CheckControlPlaneMachineOnDeleteReplacement(testFramework framework.Framework, idx int, ctx context.Context) bool

CheckControlPlaneMachineOnDeleteReplacement checks that the machines with the given index are being replaced in a on delete style with the expected conditions. This function explicitly takes a context which is expected to have a timeout in the parent scope.

func CheckControlPlaneMachineRollingReplacement

func CheckControlPlaneMachineRollingReplacement(testFramework framework.Framework, idx int, ctx context.Context) bool

CheckControlPlaneMachineRollingReplacement checks that the machines with the given index are being replaced in a rolling update style with the expected conditions. This function explicitly takes a context which is expected to have a timeout in the parent scope.

func CheckReplicasDoesNotExceedSurgeCapacity

func CheckReplicasDoesNotExceedSurgeCapacity(ctx context.Context) bool

CheckReplicasDoesNotExceedSurgeCapacity checks that, during a rolling update, the number of replicas within the control plane machine set never exceeds the desired number of replicas plus 1 additional machine for surge.

func CheckRolloutForIndex

func CheckRolloutForIndex(testFramework framework.Framework, ctx context.Context, idx int, strategy machinev1.ControlPlaneMachineSetStrategyType) bool

CheckRolloutForIndex first checks that a new machine is created in the correct index, and then checks that the new machine in the index is replaced correctly.

func ConsistentlyControlPlaneMachinesWithoutDeletionTimestamp

func ConsistentlyControlPlaneMachinesWithoutDeletionTimestamp(testFramework framework.Framework)

ConsistentlyControlPlaneMachinesWithoutDeletionTimestamp checks that none of the control plane machines have a deletion timestamp, consistently.

func DeleteControlPlaneMachineSet

func DeleteControlPlaneMachineSet(testFramework framework.Framework, ctx context.Context, cpms *machinev1.ControlPlaneMachineSet)

DeleteControlPlaneMachineSet deletes the control plane machine set.

func EnsureActiveControlPlaneMachineSet

func EnsureActiveControlPlaneMachineSet(testFramework framework.Framework, gomegaArgs ...interface{})

EnsureActiveControlPlaneMachineSet ensures that there is an active control plane machine set within the cluster. For fully supported clusters, this means waiting for the control plane machine set to be created and checking that it is active. For manually supported clusters, this means creating the control plane machine set, checking its status and then activating it.

func EnsureControlPlaneMachineSetDeleted

func EnsureControlPlaneMachineSetDeleted(testFramework framework.Framework)

EnsureControlPlaneMachineSetDeleted ensures the control plane machine set is deleted and properly removed/recreated.

func EnsureControlPlaneMachineSetUpdateStrategy

func EnsureControlPlaneMachineSetUpdateStrategy(testFramework framework.Framework, strategy machinev1.ControlPlaneMachineSetStrategyType, gomegaArgs ...interface{}) machinev1.ControlPlaneMachineSetStrategyType

EnsureControlPlaneMachineSetUpdateStrategy ensures that the control plane machine set has the specified update strategy.

func EnsureControlPlaneMachineSetUpdated

func EnsureControlPlaneMachineSetUpdated(testFramework framework.Framework)

EnsureControlPlaneMachineSetUpdated ensures the control plane machine set is up to date.

func EnsureInactiveControlPlaneMachineSet

func EnsureInactiveControlPlaneMachineSet(testFramework framework.Framework, gomegaArgs ...interface{})

EnsureInactiveControlPlaneMachineSet ensures that there is an inactive control plane machine set within the cluster.

func EventuallyClusterOperatorsShouldStabilise

func EventuallyClusterOperatorsShouldStabilise(gomegaArgs ...interface{})

EventuallyClusterOperatorsShouldStabilise checks that the cluster operators stabilise over time. Stabilise means that they are available, are not progressing, and are not degraded.

func EventuallyIndexIsBeingReplaced

func EventuallyIndexIsBeingReplaced(ctx context.Context, testFramework framework.Framework, idx int) bool

EventuallyIndexIsBeingReplaced checks that the index given, eventually receives a replacement Machine. It simultaneously checks that no other index is being replaced, this short circuits what otherwise could be a long wait.

func ExpectControlPlaneMachineSetToBeActive

func ExpectControlPlaneMachineSetToBeActive(testFramework framework.Framework)

ExpectControlPlaneMachineSetToBeActive gets the control plane machine set and checks that it is active.

func ExpectControlPlaneMachineSetToBeInactive

func ExpectControlPlaneMachineSetToBeInactive(testFramework framework.Framework)

ExpectControlPlaneMachineSetToBeInactive gets the control plane machine set and checks that it is active.

func ExpectControlPlaneMachineSetToBeInactiveOrNotFound

func ExpectControlPlaneMachineSetToBeInactiveOrNotFound(testFramework framework.Framework)

ExpectControlPlaneMachineSetToBeInactiveOrNotFound gets the control plane machine set and checks that it is inactive or not found.

func ExpectControlPlaneMachinesAllRunning

func ExpectControlPlaneMachinesAllRunning(testFramework framework.Framework)

ExpectControlPlaneMachinesAllRunning checks that all the control plane machines are in running phase.

func ExpectControlPlaneMachinesNotOwned

func ExpectControlPlaneMachinesNotOwned(testFramework framework.Framework)

ExpectControlPlaneMachinesNotOwned checks that none of the control plane machines have owner references.

func ExpectControlPlaneMachinesOwned

func ExpectControlPlaneMachinesOwned(testFramework framework.Framework)

ExpectControlPlaneMachinesOwned checks that all of the control plane machines have owner references.

func ExpectControlPlaneMachinesWithoutDeletionTimestamp

func ExpectControlPlaneMachinesWithoutDeletionTimestamp(testFramework framework.Framework)

ExpectControlPlaneMachinesWithoutDeletionTimestamp checks that none of the control plane machines has a deletion timestamp.

func GetControlPlaneMachineSetUID

func GetControlPlaneMachineSetUID(testFramework framework.Framework) types.UID

GetControlPlaneMachineSetUID gets the UID of the control plane machine set.

func IncreaseControlPlaneMachineInstanceSize

func IncreaseControlPlaneMachineInstanceSize(testFramework framework.Framework, index int, gomegaArgs ...interface{}) (machinev1beta1.ProviderSpec, machinev1beta1.ProviderSpec)

IncreaseControlPlaneMachineInstanceSize increases the instance size of the control plane machine in the given index. This should trigger the control plane machine set to update the machine in this index based on the update strategy.

func IncreaseControlPlaneMachineSetInstanceSize

func IncreaseControlPlaneMachineSetInstanceSize(testFramework framework.Framework, gomegaArgs ...interface{}) machinev1beta1.ProviderSpec

IncreaseControlPlaneMachineSetInstanceSize increases the instance size of the control plane machine set. This should trigger the control plane machine set to update the machines based on the update strategy.

func IncreaseNewestControlPlaneMachineInstanceSize

func IncreaseNewestControlPlaneMachineInstanceSize(testFramework framework.Framework, gomegaArgs ...interface{}) (int, machinev1beta1.ProviderSpec, machinev1beta1.ProviderSpec)

IncreaseNewestControlPlaneMachineInstanceSize increases the instance size of the the newest control plane machine to match the provider spec given.

func ItShouldCheckAllControlPlaneMachinesHaveCorrectOwnerReferences

func ItShouldCheckAllControlPlaneMachinesHaveCorrectOwnerReferences(testFramework framework.Framework)

ItShouldCheckAllControlPlaneMachinesHaveCorrectOwnerReferences checks that all the control plane machines have the correct owner references set.

func ItShouldHaveAnActiveControlPlaneMachineSet

func ItShouldHaveAnActiveControlPlaneMachineSet(testFramework framework.Framework)

ItShouldHaveAnActiveControlPlaneMachineSet returns an It that checks there is an active control plane machine set installed within the cluster.

func ItShouldHaveTheControlPlaneMachineSetReplicasUpdated

func ItShouldHaveTheControlPlaneMachineSetReplicasUpdated(testFramework framework.Framework)

ItShouldHaveTheControlPlaneMachineSetReplicasUpdated checks that the control plane machine set replicas are updated.

func ItShouldNotCauseARollout

func ItShouldNotCauseARollout(testFramework framework.Framework)

ItShouldNotCauseARollout checks that the control plane machine set doesn't cause a rollout.

func ItShouldNotOnDeleteReplaceTheOutdatedMachine

func ItShouldNotOnDeleteReplaceTheOutdatedMachine(testFramework framework.Framework, index int)

ItShouldNotOnDeleteReplaceTheOutdatedMachine checks that the control plane machine set does not replace the outdated machine in the given index when the update strategy is OnDelete.

func ItShouldOnDeleteReplaceTheOutDatedMachineWhenDeleted

func ItShouldOnDeleteReplaceTheOutDatedMachineWhenDeleted(testFramework framework.Framework, index int)

ItShouldOnDeleteReplaceTheOutDatedMachineWhenDeleted checks that the control plane machine set replaces the outdated machine in the given index when the update strategy is OnDelete and the outdated machine is deleted.

func ItShouldPerformARollingUpdate

func ItShouldPerformARollingUpdate(opts *RollingUpdatePeriodicTestOptions)

ItShouldPerformARollingUpdate checks that the control plane machine set performs a rolling update in the manner desired.

func ItShouldPerformControlPlaneMachineSetRegeneration

func ItShouldPerformControlPlaneMachineSetRegeneration(opts *ControlPlaneMachineSetRegenerationTestOptions, gomegaArgs ...interface{})

ItShouldPerformControlPlaneMachineSetRegeneration checks that an inactive control plane machine set is regenerated if the reference machine spec changes.

func ItShouldRollingUpdateReplaceTheOutdatedMachine

func ItShouldRollingUpdateReplaceTheOutdatedMachine(testFramework framework.Framework, index int)

ItShouldRollingUpdateReplaceTheOutdatedMachine checks that the control plane machine set replaces, via a rolling update, the outdated machine in the given index.

func ItShouldUninstallTheControlPlaneMachineSet

func ItShouldUninstallTheControlPlaneMachineSet(testFramework framework.Framework)

ItShouldUninstallTheControlPlaneMachineSet checks that the control plane machine set is correctly uninstalled when a deletion is triggered, without triggering control plane machines changes.

func UpdateControlPlaneMachineProviderSpec

func UpdateControlPlaneMachineProviderSpec(testFramework framework.Framework, index int, updatedProviderSpec machinev1beta1.ProviderSpec, gomegaArgs ...interface{})

UpdateControlPlaneMachineProviderSpec updates the provider spec of the control plane machine in the given index to match the provider spec given.

func UpdateControlPlaneMachineSetProviderSpec

func UpdateControlPlaneMachineSetProviderSpec(testFramework framework.Framework, updatedProviderSpec machinev1beta1.ProviderSpec, gomegaArgs ...interface{})

UpdateControlPlaneMachineSetProviderSpec updates the provider spec of the control plane machine set to match the provider spec given.

func UpdateDefaultedValueFromControlPlaneMachineSetProviderConfig

func UpdateDefaultedValueFromControlPlaneMachineSetProviderConfig(testFramework framework.Framework, gomegaArgs ...interface{}) machinev1beta1.ProviderSpec

UpdateDefaultedValueFromControlPlaneMachineSetProviderConfig updates a defaulted field value from the Control Plane Machine Set's provider config to test defaulting on such value.

func WaitForControlPlaneMachineSetDesiredReplicas

func WaitForControlPlaneMachineSetDesiredReplicas(ctx context.Context, cpms *machinev1.ControlPlaneMachineSet) bool

WaitForControlPlaneMachineSetDesiredReplicas waits for the control plane machine set to have the desired number of replicas. It first waits for the updated replicas to equal the desired number, and then waits for the final replica count to equal the desired number.

func WaitForControlPlaneMachineSetRemovedOrRecreated

func WaitForControlPlaneMachineSetRemovedOrRecreated(ctx context.Context, testFramework framework.Framework, oldCPMSUID types.UID) bool

WaitForControlPlaneMachineSetRemovedOrRecreated waits for the control plane machine set to be removed.

Types

type ControlPlaneMachineSetRegenerationTestOptions

type ControlPlaneMachineSetRegenerationTestOptions struct {
	TestFramework        framework.Framework
	OriginalProviderSpec machinev1beta1.ProviderSpec
	UpdatedProviderSpec  machinev1beta1.ProviderSpec
	UID                  types.UID
	Index                int
}

ControlPlaneMachineSetRegenerationTestOptions allow test cases to be configured.

type RollingUpdatePeriodicTestOptions

type RollingUpdatePeriodicTestOptions struct {
	TestFramework        framework.Framework
	RolloutTimeout       time.Duration
	StabilisationTimeout time.Duration
}

RollingUpdatePeriodicTestOptions allow the test cases to be configured.

Jump to

Keyboard shortcuts

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