clusterclient

package
v0.2.11 Latest Latest
Warning

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

Go to latest
Published: May 6, 2020 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TimeoutMachineReady = "CLUSTER_API_MACHINE_READY_TIMEOUT"
)

Variables

This section is empty.

Functions

func ExtractControlPlaneMachines

func ExtractControlPlaneMachines(machines []*clusterv1.Machine) ([]*clusterv1.Machine, []*clusterv1.Machine, error)

ExtractControlPlaneMachines separates the machines running the control plane from the incoming machines. This is currently done by looking at which machine specifies the control plane version.

func GetClusterAPIObject

func GetClusterAPIObject(client Client, clusterName, namespace string) (*clusterv1.Cluster, *clusterv1.Machine, []*clusterv1.Machine, error)

func New

func New(kubeconfig string) (*client, error)

New creates and returns a Client, the kubeconfig argument is expected to be the string representation of a valid kubeconfig.

func NewFactory

func NewFactory() *clientFactory

NewFactory returns a new cluster client factory.

func NewFromDefaultSearchPath

func NewFromDefaultSearchPath(kubeconfigFile string, overrides tcmd.ConfigOverrides) (*client, error)

NewFromDefaultSearchPath creates and returns a Client. The kubeconfigFile argument is expected to be the path to a valid kubeconfig file.

Types

type Client

type Client interface {
	Apply(string) error
	Close() error
	CreateSecret(*corev1.Secret) error
	CreateClusterObject(*clusterv1.Cluster) error
	CreateMachineDeployments([]*clusterv1.MachineDeployment, string) error
	CreateMachineSets([]*clusterv1.MachineSet, string) error
	CreateMachines([]*clusterv1.Machine, string) error
	CreateUnstructuredObject(*unstructured.Unstructured) error
	Delete(string) error
	DeleteClusters(string) error
	DeleteNamespace(string) error
	DeleteMachineDeployments(string) error
	DeleteMachineSets(string) error
	DeleteMachines(string) error
	ForceDeleteSecret(namespace, name string) error
	ForceDeleteCluster(namespace, name string) error
	ForceDeleteMachine(namespace, name string) error
	ForceDeleteMachineSet(namespace, name string) error
	ForceDeleteMachineDeployment(namespace, name string) error
	ForceDeleteUnstructuredObject(*unstructured.Unstructured) error
	EnsureNamespace(string) error
	GetKubeconfigFromSecret(namespace, clusterName string) (string, error)
	GetClusterSecrets(*clusterv1.Cluster) ([]*corev1.Secret, error)
	GetClusters(string) ([]*clusterv1.Cluster, error)
	GetCluster(string, string) (*clusterv1.Cluster, error)
	GetContextNamespace() string
	GetMachineDeployment(namespace, name string) (*clusterv1.MachineDeployment, error)
	GetMachineDeploymentsForCluster(*clusterv1.Cluster) ([]*clusterv1.MachineDeployment, error)
	GetMachineDeployments(string) ([]*clusterv1.MachineDeployment, error)
	GetMachineSet(namespace, name string) (*clusterv1.MachineSet, error)
	GetMachineSets(namespace string) ([]*clusterv1.MachineSet, error)
	GetMachineSetsForCluster(*clusterv1.Cluster) ([]*clusterv1.MachineSet, error)
	GetMachineSetsForMachineDeployment(*clusterv1.MachineDeployment) ([]*clusterv1.MachineSet, error)
	GetMachines(namespace string) ([]*clusterv1.Machine, error)
	GetMachinesForCluster(*clusterv1.Cluster) ([]*clusterv1.Machine, error)
	GetMachinesForMachineSet(*clusterv1.MachineSet) ([]*clusterv1.Machine, error)
	GetUnstructuredObject(*unstructured.Unstructured) error
	ScaleDeployment(namespace, name string, scale int32) error
	WaitForClusterV1alpha2Ready() error
	WaitForResourceStatuses() error
	SetClusterOwnerRef(runtime.Object, *clusterv1.Cluster) error
}

Provides interaction with a cluster

type Factory

type Factory interface {
	NewClientFromKubeconfig(string) (Client, error)
	NewCoreClientsetFromKubeconfigFile(string) (*kubernetes.Clientset, error)
}

Factory can create cluster clients.

Jump to

Keyboard shortcuts

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