Documentation

Index

Constants

View Source
const (
	DefaultDialTimeout    = 5 * time.Second
	DefaultRequestTimeout = 5 * time.Second

	EnvOperatorPodName      = "MY_POD_NAME"
	EnvOperatorPodNamespace = "MY_POD_NAMESPACE"

	CliCertFile = "etcd-client.crt"
	CliKeyFile  = "etcd-client.key"
	CliCAFile   = "etcd-client-ca.crt"
)
View Source
const (
	EtcdVersionAnnotationKey = "etcd.version"

	EtcdClientPort = 2379
)
View Source
const DefaultTimeoutSecond = 5 * time.Second

Variables

This section is empty.

Functions

func GetEtcdVersion

func GetEtcdVersion(pod *v1.Pod) string

func GetPodNames

func GetPodNames(pods []*v1.Pod) []string

func ListMembers

func ListMembers(clientURLs []string, tc *tls.Config) (*clientv3.MemberListResponse, error)

func MemberNameFromPeerURL

func MemberNameFromPeerURL(pu string) (string, error)

func MemberRemoveEvent

func MemberRemoveEvent(memberName string, cl *api.Etcd) *v1.Event

func MemberUpgradedEvent

func MemberUpgradedEvent(memberName string, oldVersion, newVersion types.StrYo, cl *api.Etcd) *v1.Event

func NewMemberAddEvent

func NewMemberAddEvent(memberName string, cl *api.Etcd) *v1.Event

func RemoveMember

func RemoveMember(clientURLs []string, tc *tls.Config, id uint64) error

func ReplacingDeadMemberEvent

func ReplacingDeadMemberEvent(memberName string, cl *api.Etcd) *v1.Event

func UniqueMemberName

func UniqueMemberName(clusterName string) string

Types

type Member

type Member struct {
	Name      string
	Namespace string
	Service   string

	ID uint64

	SecureClient bool
	SecurePeer   bool
}

func NewMember

func NewMember(name, namespace, service string) *Member

func (*Member) Addr

func (m *Member) Addr() string

func (*Member) BuildEtcdArgs

func (m *Member) BuildEtcdArgs() []string

func (*Member) ClientURL

func (m *Member) ClientURL() string

func (*Member) ListenClientURL

func (m *Member) ListenClientURL() string

func (*Member) ListenPeerURL

func (m *Member) ListenPeerURL() string

func (*Member) PeerURL

func (m *Member) PeerURL() string

type MemberSet

type MemberSet map[string]*Member

func NewMemberSet

func NewMemberSet(ms ...*Member) MemberSet

func (MemberSet) Add

func (ms MemberSet) Add(m *Member)

func (MemberSet) ClientURLs

func (ms MemberSet) ClientURLs() []string

func (MemberSet) Diff

func (ms MemberSet) Diff(other MemberSet) MemberSet

func (MemberSet) IsEqual

func (ms MemberSet) IsEqual(other MemberSet) bool

func (MemberSet) PeerURLPairs

func (ms MemberSet) PeerURLPairs() []string

func (MemberSet) PickOne

func (ms MemberSet) PickOne() *Member

func (MemberSet) Remove

func (ms MemberSet) Remove(name string)

func (MemberSet) Size

func (ms MemberSet) Size() int