Documentation ¶
Index ¶
- Constants
- Variables
- func CreateMachineHealthCheck(labels map[string]string) error
- func CreateUnhealthyConditionsConfigMap(unhealthyConditions *conditions.UnhealthyConditions) error
- func DeleteObjectsByLabels(ctx context.Context, client runtimeclient.Client, labels map[string]string, ...) error
- func DeleteUnhealthyConditionsConfigMap() error
- func FilterReadyNodes(nodes []corev1.Node) []corev1.Node
- func GetMachine(ctx context.Context, client runtimeclient.Client, machineName string) (*mapiv1beta1.Machine, error)
- func GetMachineFromNode(client runtimeclient.Client, node *corev1.Node) (*mapiv1beta1.Machine, error)
- func GetMachineSet(ctx context.Context, client runtimeclient.Client, machineSetName string) (*mapiv1beta1.MachineSet, error)
- func GetMachineSets(ctx context.Context, client runtimeclient.Client, labels ...map[string]string) ([]mapiv1beta1.MachineSet, error)
- func GetMachines(ctx context.Context, client runtimeclient.Client, labels ...map[string]string) ([]mapiv1beta1.Machine, error)
- func GetNodes(client runtimeclient.Client, labels ...map[string]string) ([]corev1.Node, error)
- func GetWorkerNodes(client runtimeclient.Client) ([]corev1.Node, error)
- func IsKubemarkProvider(client runtimeclient.Client) (bool, error)
- func IsNodeReady(node *corev1.Node) bool
- func LoadClient() (runtimeclient.Client, error)
- func LoadClientset() (*kubernetes.Clientset, error)
- func LoadConfig() (*rest.Config, error)
- func LoadPrivateKey(prkey string) (ssh.Signer, error)
- func LoadRestClient() (*rest.RESTClient, error)
- func ReadKubeconfigFromServer(sshConfig *SSHConfig) (string, error)
- func RestclientConfig() (*clientcmdapi.Config, error)
- func SigKubeDescribe(text string, body func()) bool
- func StopKubelet(nodeName string) error
- func WaitUntilAllNodesAreReady(client runtimeclient.Client) error
- func WaitUntilCreated(createFnc func() error, getFnc func() error) error
- func WaitUntilDeleted(delFnc func() error, getFnc func() error) error
- type ByFnc
- type ErrNotExpectedFnc
- type Framework
- func (f *Framework) BeforeEach()
- func (f *Framework) CreateClusterAndWait(cluster *clusterv1alpha1.Cluster)
- func (f *Framework) CreateMachineAndWait(machine *machinev1beta1.Machine, client types.CloudProviderClient)
- func (f *Framework) CreateMachineSetAndWait(machineset *machinev1beta1.MachineSet, client types.CloudProviderClient)
- func (f *Framework) DefaultBy(msg string)
- func (f *Framework) DefaultErrNotExpected(err error)
- func (f *Framework) DeleteMachineAndWait(machine *machinev1beta1.Machine, client types.CloudProviderClient)
- func (f *Framework) DeleteMachineSetAndWait(machineset *machinev1beta1.MachineSet, client types.CloudProviderClient) error
- func (f *Framework) DeployClusterAPIStack(clusterAPINamespace, actuatorPrivateKey string)
- func (f *Framework) DestroyClusterAPIStack(clusterAPINamespace, actuatorPrivateKey string)
- func (f *Framework) GetMasterMachineRestConfig(masterMachine *machinev1beta1.Machine, client types.CloudProviderClient) (*rest.Config, error)
- func (f *Framework) IgnoreNotFoundErr(err error)
- func (f *Framework) ScaleDeploymentDownToZero(deployment *appsv1beta2.Deployment) error
- func (f *Framework) ScaleSatefulSetDownToZero(statefulset *appsv1beta2.StatefulSet) error
- func (f *Framework) UploadDockerImageToInstance(image, targetMachine string) error
- func (f *Framework) WaitForNodesToGetReady(count int) error
- type MachinesToDelete
- type SSHConfig
- type TestContextType
Constants ¶
const ( WorkerNodeRoleLabel = "node-role.kubernetes.io/worker" WaitShort = 1 * time.Minute WaitMedium = 3 * time.Minute WaitLong = 10 * time.Minute 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 )
const ( // Default timeout for pools PoolTimeout = 5 * time.Minute // Default waiting interval for pools PollInterval = 5 * time.Second // Node waiting internal PollNodeInterval = 5 * time.Second // Pool timeout for cluster API deployment PoolClusterAPIDeploymentTimeout = 10 * time.Minute PoolDeletionTimeout = 1 * time.Minute // Pool timeout for kubeconfig PoolKubeConfigTimeout = 10 * time.Minute PoolNodesReadyTimeout = 10 * time.Minute // Instances are running timeout TimeoutPoolMachineRunningInterval = 10 * time.Minute )
const ( // KubeletKillerPodName contains the name of the pod that stops kubelet process KubeletKillerPodName = "kubelet-killer" // MachineHealthCheckName contains the name of the machinehealthcheck used for tests MachineHealthCheckName = "workers-check" )
Variables ¶
var ClusterID string
ClusterID set by -cluster-id flag
Functions ¶
func CreateMachineHealthCheck ¶
CreateMachineHealthCheck will create MachineHealthCheck CR with the relevant selector
func CreateUnhealthyConditionsConfigMap ¶
func CreateUnhealthyConditionsConfigMap(unhealthyConditions *conditions.UnhealthyConditions) error
CreateUnhealthyConditionsConfigMap creates node-unhealthy-conditions configmap with relevant conditions
func DeleteObjectsByLabels ¶
func DeleteObjectsByLabels(ctx context.Context, client runtimeclient.Client, labels map[string]string, list runtime.Object) error
DeleteObjectsByLabels list all objects of a given kind by labels and deletes them. Currently supported kinds: - caov1beta1.MachineAutoscalerList - caov1.ClusterAutoscalerList - batchv1.JobList
func DeleteUnhealthyConditionsConfigMap ¶
func DeleteUnhealthyConditionsConfigMap() error
DeleteUnhealthyConditionsConfigMap deletes node-unhealthy-conditions configmap
func FilterReadyNodes ¶
FilterReadyNodes fileter the list of nodes and returns the list with ready nodes
func GetMachine ¶
func GetMachine(ctx context.Context, client runtimeclient.Client, machineName string) (*mapiv1beta1.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) (*mapiv1beta1.Machine, error)
GetMachineFromNode returns the machine referenced by the "controllernode.MachineAnnotationKey" annotation in the given node
func GetMachineSet ¶
func GetMachineSet(ctx context.Context, client runtimeclient.Client, machineSetName string) (*mapiv1beta1.MachineSet, error)
GetMachineSet gets a machineset by its name from the default machine API namespace.
func GetMachineSets ¶
func GetMachineSets(ctx context.Context, client runtimeclient.Client, labels ...map[string]string) ([]mapiv1beta1.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, labels ...map[string]string) ([]mapiv1beta1.Machine, error)
GetMachines gets a list of machinesets from the default machine API namespace. Optionaly, labels may be used to constrain listed machinesets.
func GetNodes ¶
GetNodes gets a list of nodes from a running cluster Optionaly, labels may be used to constrain listed nodes.
func GetWorkerNodes ¶
func GetWorkerNodes(client runtimeclient.Client) ([]corev1.Node, error)
GetWorkerNodes returns all nodes with the nodeWorkerRoleLabel label
func IsKubemarkProvider ¶
func IsKubemarkProvider(client runtimeclient.Client) (bool, error)
func IsNodeReady ¶
func LoadClient ¶
func LoadClient() (runtimeclient.Client, error)
LoadClient builds controller runtime client that accepts any registered type
func LoadClientset ¶
func LoadClientset() (*kubernetes.Clientset, error)
func LoadConfig ¶
LoadConfig builds config from kubernetes config
func LoadRestClient ¶
func LoadRestClient() (*rest.RESTClient, error)
func RestclientConfig ¶
func RestclientConfig() (*clientcmdapi.Config, error)
RestclientConfig builds a REST client config
func SigKubeDescribe ¶
SigKubeDescribe is a wrapper function for ginkgo describe. Adds namespacing.
func StopKubelet ¶
StopKubelet creates pod in the node PID namespace that stops kubelet process
func WaitUntilAllNodesAreReady ¶
func WaitUntilAllNodesAreReady(client runtimeclient.Client) error
func WaitUntilCreated ¶
func WaitUntilDeleted ¶
Types ¶
type ErrNotExpectedFnc ¶
type ErrNotExpectedFnc func(error)
type Framework ¶
type Framework struct { KubeClient *kubernetes.Clientset CAPIClient *clientset.Clientset APIExtensionClient *apiextensionsclientset.Clientset HealthCheckingClient *healthcheckingclient.Clientset // APIRegistrationClient *apiregistrationclientset.Clientset Kubeconfig string RestConfig *rest.Config SSH *SSHConfig LibvirtURI string LibvirtPK string MachineControllerImage string MachineManagerImage string NodelinkControllerImage string ErrNotExpected ErrNotExpectedFnc By ByFnc }
Framework supports common operations used by tests
func NewFrameworkFromConfig ¶
func (*Framework) BeforeEach ¶
func (f *Framework) BeforeEach()
BeforeEach to be run before each spec responsible for building various clientsets
func (*Framework) CreateClusterAndWait ¶
func (f *Framework) CreateClusterAndWait(cluster *clusterv1alpha1.Cluster)
func (*Framework) CreateMachineAndWait ¶
func (f *Framework) CreateMachineAndWait(machine *machinev1beta1.Machine, client types.CloudProviderClient)
func (*Framework) CreateMachineSetAndWait ¶
func (f *Framework) CreateMachineSetAndWait(machineset *machinev1beta1.MachineSet, client types.CloudProviderClient)
func (*Framework) DefaultErrNotExpected ¶
func (*Framework) DeleteMachineAndWait ¶
func (f *Framework) DeleteMachineAndWait(machine *machinev1beta1.Machine, client types.CloudProviderClient)
func (*Framework) DeleteMachineSetAndWait ¶
func (f *Framework) DeleteMachineSetAndWait(machineset *machinev1beta1.MachineSet, client types.CloudProviderClient) error
func (*Framework) DeployClusterAPIStack ¶
func (*Framework) DestroyClusterAPIStack ¶
func (*Framework) GetMasterMachineRestConfig ¶
func (f *Framework) GetMasterMachineRestConfig(masterMachine *machinev1beta1.Machine, client types.CloudProviderClient) (*rest.Config, error)
func (*Framework) IgnoreNotFoundErr ¶
IgnoreNotFoundErr ignores not found errors in case resource that does not exist is to be deleted
func (*Framework) ScaleDeploymentDownToZero ¶
func (f *Framework) ScaleDeploymentDownToZero(deployment *appsv1beta2.Deployment) error
func (*Framework) ScaleSatefulSetDownToZero ¶
func (f *Framework) ScaleSatefulSetDownToZero(statefulset *appsv1beta2.StatefulSet) error
func (*Framework) UploadDockerImageToInstance ¶
func (*Framework) WaitForNodesToGetReady ¶
type MachinesToDelete ¶
type MachinesToDelete struct {
// contains filtered or unexported fields
}
func InitMachinesToDelete ¶
func InitMachinesToDelete() *MachinesToDelete
func (*MachinesToDelete) AddMachine ¶
func (m *MachinesToDelete) AddMachine(machine *machinev1beta1.Machine, framework *Framework, client types.CloudProviderClient)
func (*MachinesToDelete) AddMachineSet ¶
func (m *MachinesToDelete) AddMachineSet(machineset *machinev1beta1.MachineSet, framework *Framework, client types.CloudProviderClient)
func (*MachinesToDelete) Delete ¶
func (m *MachinesToDelete) Delete()
type SSHConfig ¶
func DefaultSSHConfig ¶
type TestContextType ¶
var TestContext TestContextType