clustercache

package
v0.0.0-...-23d5cae Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrLostQuorum = errors.New("lost quorum")

Functions

func PodsToMemberSet

func PodsToMemberSet(pods []*v1.Pod, sc bool) etcdutil.MemberSet

Types

type Config

type Config struct {
	KubeCli kubernetes.Interface
}

type EtcdClusterHandler

type EtcdClusterHandler struct {
	K8sServices k8sutil.Services
	MetaCache   *MetaMap
	Logger      logr.Logger
}

func (*EtcdClusterHandler) Check

func (h *EtcdClusterHandler) Check(cl *MetaCluster) error

func (*EtcdClusterHandler) Do

func (h *EtcdClusterHandler) Do(cl *api.Cluster) error

type MetaCluster

type MetaCluster struct {
	Logger  *logrus.Entry
	Name    string
	Cluster *api.Cluster
	Status  api.ClusterStatus
	Members etcdutil.MemberSet

	Config map[string]string
	// contains filtered or unexported fields
}

func (*MetaCluster) IsSecureClient

func (c *MetaCluster) IsSecureClient() bool

func (*MetaCluster) PollPods

func (c *MetaCluster) PollPods() (running, pending []*v1.Pod, err error)

func (*MetaCluster) Setup

func (c *MetaCluster) Setup(h *EtcdClusterHandler) error

func (*MetaCluster) UpdateCRStatus

func (c *MetaCluster) UpdateCRStatus(h *EtcdClusterHandler) error

func (*MetaCluster) UpdateMembers

func (c *MetaCluster) UpdateMembers(known etcdutil.MemberSet) error

type MetaMap

type MetaMap struct {
	sync.Map
}

func (*MetaMap) Add

func (c *MetaMap) Add(cluster *api.Cluster)

func (*MetaMap) Cache

func (c *MetaMap) Cache(cluster *api.Cluster) (*MetaCluster, bool)

func (*MetaMap) Get

func (c *MetaMap) Get(cluster *api.Cluster) *MetaCluster

func (*MetaMap) Update

func (c *MetaMap) Update(meta *MetaCluster, cluster *api.Cluster)

Jump to

Keyboard shortcuts

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