Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 ¶
ReadServiceName returns a name for the read service associated with the given clusterName.
func ServiceName ¶
ServiceName returns a name for the service associated with the given clusterName.
func StatefulSetName ¶
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.