helpers

package
v1.2.2-dev1 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: Apache-2.0, BSD-3-Clause Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CloneRepo

func CloneRepo(source string, destinationDir string) error

CloneRepo clones github repo locally. This is required if there is no mcm container image tag supplied or the clusters are not seed (control) and shoot (target) clusters

func ParseK8sYaml

func ParseK8sYaml(filepath string) ([]runtime.Object, []*schema.GroupVersionKind, error)

ParseK8sYaml reads a yaml file and parses it based on the scheme

Types

type Cluster

type Cluster struct {
	Clientset *kubernetes.Clientset

	McmClient          *mcmClientset.Clientset
	RbacClient         *rbac.RbacV1Client
	KubeConfigFilePath string
	// contains filtered or unexported fields
}

Cluster type to hold cluster specific details

func NewCluster

func NewCluster(kubeConfigPath string) (c *Cluster, e error)

NewCluster returns a Cluster struct

func (*Cluster) ApplyFiles

func (c *Cluster) ApplyFiles(source string, namespace string) error

ApplyFiles invokes ApplyFile on a each file

func (*Cluster) ClusterName

func (c *Cluster) ClusterName() (string, error)

ClusterName retrieves cluster name from the kubeconfig

func (*Cluster) CreateMachine

func (c *Cluster) CreateMachine(namespace string) error

CreateMachine creates a test-machine using machineclass "test-mc"

func (*Cluster) CreateMachineDeployment

func (c *Cluster) CreateMachineDeployment(namespace string) error

CreateMachineDeployment creates a test-machine-deployment with 3 replicas and returns error if it occurs

func (*Cluster) DeleteResources

func (c *Cluster) DeleteResources(source string, namespace string) error

DeleteResources invokes DeleteResource on a each file

func (*Cluster) FillClientSets

func (c *Cluster) FillClientSets() error

FillClientSets checks whether the cluster is accessible and returns an error if not

func (*Cluster) GetNumberOfNodes

func (c *Cluster) GetNumberOfNodes() int16

GetNumberOfNodes tries to retrieve the list of node objects in the cluster.

func (*Cluster) GetNumberOfReadyNodes

func (c *Cluster) GetNumberOfReadyNodes() int16

GetNumberOfReadyNodes tries to retrieve the list of node objects in the cluster.

func (*Cluster) GetSecretData

func (c *Cluster) GetSecretData(machineClassName string, secretRefs ...*v1.SecretReference) (map[string][]byte, error)

GetSecretData combines secrets

func (*Cluster) IsSeed

func (c *Cluster) IsSeed(target *Cluster) bool

IsSeed checks whether the cluster is seed of target cluster

func (*Cluster) IsTestMachineDeleted

func (c *Cluster) IsTestMachineDeleted() bool

IsTestMachineDeleted returns boolean value of presence of 'test-machine' object

func (*Cluster) ProbeNodes

func (c *Cluster) ProbeNodes() error

ProbeNodes tries to probe for nodes.

type ResourcesTrackerInterface

type ResourcesTrackerInterface interface {
	IsOrphanedResourcesAvailable() bool
	InitializeResourcesTracker(
		machineClass *v1alpha1.MachineClass,
		secretData map[string][]byte,
		clusterName string,
	) error
}

ResourcesTrackerInterface provides an interface to check for orphan resources. The implementation should handle probing for resources while contructing or calling New method And reporting orphan resources whenever IsOrphanedResourcesAvailable is invoked

Jump to

Keyboard shortcuts

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