framework

package
v0.0.0-...-cfddc49 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2024 License: Apache-2.0 Imports: 66 Imported by: 1

Documentation

Index

Constants

View Source
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.

View Source
const (
	Amd64     = "amd64"
	ArchLabel = "e2e.openshift.io/arch"

	ReasonKey = "machine.openshift.io/reason"
	ReasonE2E = "actuator-e2e"
)

Variables

View Source
var (
	WaitShort      = 1 * time.Minute
	WaitMedium     = 3 * time.Minute
	WaitOverMedium = 5 * time.Minute
	WaitLong       = 15 * time.Minute
	WaitOverLong   = 30 * time.Minute
)
View Source
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")
)
View Source
var DefaultMutatingWebhookConfiguration = webhooks.NewMachineMutatingWebhookConfiguration()

DefaultMutatingWebhookConfiguration is a default mutating webhook configuration resource provided by MAO.

View Source
var DefaultValidatingWebhookConfiguration = webhooks.NewMachineValidatingWebhookConfiguration()

DefaultValidatingWebhookConfiguration is a default validating webhook configuration resource provided by MAO.

View Source
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

func ConfigureClusterWideProxy(c client.Client, gomegaArgs ...interface{})

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

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

func DeleteDaemonset(ctx context.Context, c client.Client, deployment *kappsapi.DaemonSet) error

DeleteDaemonset deletes the specified deployment.

func DeleteDeployment

func DeleteDeployment(ctx context.Context, c client.Client, deployment *kappsapi.Deployment) error

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

func DeleteProxy(c client.Client, gomegaArgs ...interface{})

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

func DeployProxy(c client.Client, gomegaArgs ...interface{})

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

func FilterMachines(machines []*machinev1.Machine, phase string) []*machinev1.Machine

FilterMachines returns a slice of only those Machines in the input that are in the requested phase.

func FilterReadyNodes

func FilterReadyNodes(nodes []corev1.Node) []corev1.Node

FilterReadyNodes filters the list of nodes and returns a list with ready nodes.

func FilterRunningMachines

func FilterRunningMachines(machines []*machinev1.Machine) []*machinev1.Machine

FilterRunningMachines returns a slice of only those Machines in the input that are in the "Running" phase.

func FilterSchedulableNodes

func FilterSchedulableNodes(nodes []corev1.Node) []corev1.Node

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 GetContext

func GetContext() context.Context

GetContext returns a context.

func GetControlPlaneHostAndPort

func GetControlPlaneHostAndPort(ctx context.Context, cl client.Client) (string, int32, error)

func GetCredentialsFromCluster

func GetCredentialsFromCluster(oc *gatherer.CLI) ([]byte, []byte, string)

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

func GetMachine(c runtimeclient.Client, name string) (*machinev1.Machine, error)

GetMachine get a machine by its name from the default machine API namespace.

func GetMachineFromNode

func GetMachineFromNode(client runtimeclient.Client, node *corev1.Node) (*machinev1.Machine, error)

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

GetPlatform fetches the PlatformType from the infrastructure object. Caches value after first successful retrieval.

func GetPods

func GetPods(client runtimeclient.Client, selector map[string]string) (*corev1.PodList, error)

GetPods returns a list of pods matching the provided selector.

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

func IsDaemonsetAvailable(ctx context.Context, c client.Client, name, namespace string) bool

IsDaemonsetAvailable returns true if the deployment has one or more available replicas.

func IsDeploymentAvailable

func IsDeploymentAvailable(ctx context.Context, c client.Client, name, namespace string) bool

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

func IsMutatingWebhookConfigurationSynced(ctx context.Context, c client.Client) bool

IsMutatingWebhookConfigurationSynced expects a matching MutatingWebhookConfiguration to be present in the cluster.

func IsNodeReady

func IsNodeReady(node *corev1.Node) bool

IsNodeReady returns true if the given node is ready.

func IsNodeSchedulable

func IsNodeSchedulable(node *corev1.Node) bool

IsNodeSchedulable returns true is the given node can schedule workloads.

func IsServiceAvailable

func IsServiceAvailable(ctx context.Context, c runtimeclient.Client, name, namespace string) bool

IsServiceAvailable returns true if the service exists.

func IsValidatingWebhookConfigurationSynced

func IsValidatingWebhookConfigurationSynced(ctx context.Context, c client.Client) bool

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

func MachinesPresent(existingMachines []*machinev1.Machine, machines ...*machinev1.Machine) bool

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

func NewCLI() (*gatherer.CLI, error)

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 NewWorkLoad(njobs int32, memoryRequest resource.Quantity, workloadJobName string,
	testLabel string, podLabel string, nodeSelectorReqs ...corev1.NodeSelectorRequirement) *batchv1.Job

func NodesAreReady

func NodesAreReady(nodes []*corev1.Node) bool

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

func ScaleMachineSet(name string, replicas int) error

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

func UnconfigureClusterWideProxy(c client.Client, gomegaArgs ...interface{})

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

func WaitForCAPIMachinesRunning(ctx context.Context, cl client.Client, name string)

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

func WaitForEvent(ctx context.Context, c runtimeclient.Client, kind, name, reason string) error

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

func WaitForSpotMachineSet(ctx context.Context, c runtimeclient.Client, name string) error

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 WaitForStatusAvailableMedium

func WaitForStatusAvailableMedium(ctx context.Context, client runtimeclient.Client, name string) bool

func WaitForStatusAvailableOverLong

func WaitForStatusAvailableOverLong(ctx context.Context, client runtimeclient.Client, name string) bool

func WaitForStatusAvailableShort

func WaitForStatusAvailableShort(ctx context.Context, client runtimeclient.Client, name string) bool

func WaitForValidatingWebhook

func WaitForValidatingWebhook(ctx context.Context, client runtimeclient.Client, name string) bool

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

func WaitUntilNodeDoesNotExists

func WaitUntilNodeDoesNotExists(ctx context.Context, client runtimeclient.Client, nodeName string) error

Types

type AwsClient

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

AwsClient struct.

func NewAwsClient

func NewAwsClient(accessKeyID []byte, secureKey []byte, clusterRegion string) *AwsClient

Init the aws client.

func (*AwsClient) CancelCapacityReservation

func (a *AwsClient) CancelCapacityReservation(capacityReservationID string) (bool, error)

CancelCapacityReservation Cancel a CapacityReservation.

func (*AwsClient) CreateCapacityReservation

func (a *AwsClient) CreateCapacityReservation(instanceType string, instancePlatform string, availabilityZone string, instanceCount int64) (string, error)

CreateCapacityReservation Create CapacityReservation.

func (*AwsClient) CreatePlacementGroup

func (a *AwsClient) CreatePlacementGroup(groupName string, strategy string, partitionCount ...int64) (string, error)

CreatePlacementGroup Create a PlacementGroup.

func (*AwsClient) DeletePlacementGroup

func (a *AwsClient) DeletePlacementGroup(groupName string) (string, error)

DeletePlacementGroup Delete a PlacementGroup.

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

type PodLastLogFunc

type PodLastLogFunc func(container string, lines int, previous bool) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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