cluster

package
v0.0.0-...-87ef7df Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FuncMap = template.FuncMap{
	"PVCName":         backupschedule.PVCName,
	"StatefulSetName": StatefulSetName,
	"ServiceName":     ServiceName,
	"ReadServiceName": ReadServiceName,
}

FuncMap can be used to execute templates with the helper functions from the cluster operator.

Functions

func CreateConfigMap

func CreateConfigMap(namespace string, clientset kubernetes.Interface) error

CreateConfigMap registers a "mysql" config map used by MySQL Clusters.

func ReadServiceName

func ReadServiceName(clusterName string) string

ReadServiceName returns a name for the read service associated with the given clusterName.

func ServiceName

func ServiceName(clusterName string) string

ServiceName returns a name for the service associated with the given clusterName.

func StatefulSetName

func StatefulSetName(clusterName string) string

StatefulSetName returns a name for the stateful set associated with the given clusterName.

Types

type FakeClusterOperator

type FakeClusterOperator struct {
	// contains filtered or unexported fields
}

FakeClusterOperator may be used in tests as a cluster operator. It implements all operator functions as simply returning an fail set via SetError.

func NewFakeOperator

func NewFakeOperator() *FakeClusterOperator

NewFakeOperator returns new operator that does nothing.

func (*FakeClusterOperator) AddCluster

func (c *FakeClusterOperator) AddCluster(cluster *crv1.MySQLCluster) error

AddCluster simulates adding a cluster. Returns fail set via SetError.

func (*FakeClusterOperator) SetError

func (c *FakeClusterOperator) SetError(err error)

SetError can be used to simulate operator failures.

func (*FakeClusterOperator) UpdateCluster

func (c *FakeClusterOperator) UpdateCluster(newCluster *crv1.MySQLCluster) error

UpdateCluster simulates updating a cluster. Returns fail set via SetError.

type Operator

type Operator interface {
	// AddCluster creates the Kubernetes API objects necessary for a MySQL cluster.
	AddCluster(cluster *crv1.MySQLCluster) error
	UpdateCluster(newCluster *crv1.MySQLCluster) error
}

Operator represents an object to manipulate MySQLCluster custom resources.

func NewClusterOperator

func NewClusterOperator(clientset versioned.Interface, kubeClientset kubernetes.Interface) Operator

NewClusterOperator returns a new Operator.

Jump to

Keyboard shortcuts

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