clusterprovider

package
v0.0.1-alpha.2 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DynamicClient dynamic.Interface

Functions

func GetEtcdClusterMemberStatus

func GetEtcdClusterMemberStatus(
	members []kstoneapiv1.MemberStatus,
	tls *transport.TLSInfo) ([]kstoneapiv1.MemberStatus, kstoneapiv1.EtcdClusterPhase)

GetEtcdClusterMemberStatus check healthy of cluster and member

func GetRuntimeEtcdMembers

func GetRuntimeEtcdMembers(
	endpoints []string,
	extensionClientURLs string,
	tls *transport.TLSInfo) ([]kstoneapiv1.MemberStatus, error)

GetRuntimeEtcdMembers get members of etcd

func GetStorageMemberEndpoints

func GetStorageMemberEndpoints(cluster *kstoneapiv1.EtcdCluster) []string

GetStorageMemberEndpoints get member of cluster status

func Init

func Init(config *rest.Config) error

Init inits DynamicClient TODO: fix me,remove DynamicClient

func RegisterEtcdClusterFactory

func RegisterEtcdClusterFactory(name kstoneapiv1.EtcdClusterType, factory EtcdFactory)

RegisterEtcdClusterFactory registers the specified cluster provider

Types

type Cluster

type Cluster interface {
	// BeforeCreate does some things before creating the cluster
	BeforeCreate() error
	// Create creates the cluster
	Create() error
	// AfterCreate does some things after creating the cluster
	AfterCreate() error

	// BeforeUpdate does some things before updating the cluster
	BeforeUpdate() error
	// Update updates the cluster
	Update() error
	// AfterUpdate does some things after updating the cluster
	AfterUpdate() error

	// BeforeDelete does some things before deleting the cluster
	BeforeDelete() error
	// Delete deletes the cluster
	Delete() error
	// AfterDelete does some things after deleting the cluster
	AfterDelete() error

	// Equal checks whether the cluster needs to be updated
	Equal() (bool, error)

	// Status gets the cluster status
	Status(tlsConfig *transport.TLSInfo) (kstoneapiv1.EtcdClusterStatus, error)
}

Cluster is an abstract, pluggable interface for etcd clusters.

func GetEtcdClusterProvider

func GetEtcdClusterProvider(
	name kstoneapiv1.EtcdClusterType,
	cluster *kstoneapiv1.EtcdCluster,
) (Cluster, error)

GetEtcdClusterProvider gets the specified cluster provider

type EtcdFactory

type EtcdFactory func(cluster *kstoneapiv1.EtcdCluster) (Cluster, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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