Documentation ¶
Index ¶
- Constants
- func RegisterMetrics()
- func SelectorForCluster(c *v1alpha1.Cluster) labels.Selector
- func SelectorForClusterOperatorVersion(operatorVersion string) labels.Selector
- type ConfigMapControlInterface
- type MySQLController
- type PodControlInterface
- type SecretControlInterface
- type ServiceControlInterface
- type StatefulSetControlInterface
Constants ¶
const ( // SuccessSynced is used as part of the Event 'reason' when a MySQSL is // synced. SuccessSynced = "Synced" // ErrResourceExists is used as part of the Event 'reason' when a // Cluster fails to sync due to a resource of the same name already // existing. ErrResourceExists = "ErrResourceExists" // MessageResourceExists is the message used for Events when a resource // fails to sync due to a resource already existing. MessageResourceExists = "%s %s/%s already exists and is not managed by Cluster" // MessageResourceSynced is the message used for an Event fired when a // Cluster is synced successfully MessageResourceSynced = "Cluster synced successfully" )
Variables ¶
This section is empty.
Functions ¶
func SelectorForCluster ¶
SelectorForCluster creates a labels.Selector to match a given clusters associated resources.
func SelectorForClusterOperatorVersion ¶
SelectorForClusterOperatorVersion creates a labels.Selector to match a given clusters associated resources MySQLOperatorVersionLabel.
Types ¶
type ConfigMapControlInterface ¶
ConfigMapControlInterface defines the interface that the ClusterController uses to create Configmaps. It is implemented as an interface to enable testing.
func NewRealConfigMapControl ¶
func NewRealConfigMapControl(client kubernetes.Interface) ConfigMapControlInterface
NewRealConfigMapControl creates a concrete implementation of the ConfigMapControlInterface.
type MySQLController ¶
type MySQLController struct {
// contains filtered or unexported fields
}
The MySQLController watches the Kubernetes API for changes to MySQL resources
func NewController ¶
func NewController( opConfig operatoropts.MySQLOperatorOpts, opClient clientset.Interface, kubeClient kubernetes.Interface, clusterInformer informersv1alpha1.ClusterInformer, statefulSetInformer appsinformers.StatefulSetInformer, podInformer coreinformers.PodInformer, serviceInformer coreinformers.ServiceInformer, resyncPeriod time.Duration, namespace string, ) *MySQLController
NewController creates a new MySQLController.
func (*MySQLController) Run ¶
func (m *MySQLController) Run(ctx context.Context, threadiness int)
Run will set up the event handlers for types we are interested in, as well as syncing informer caches and starting workers. It will block until stopCh is closed, at which point it will shutdown the workqueue and wait for workers to finish processing their current work items.
type PodControlInterface ¶
PodControlInterface defines the interface that the ClusterController uses to create, update, and delete mysql pods. It is implemented as an interface to enable testing.
func NewRealPodControl ¶
func NewRealPodControl(client kubernetes.Interface, podLister corelistersv1.PodLister) PodControlInterface
NewRealPodControl creates a concrete implementation of the PodControlInterface.
type SecretControlInterface ¶
type SecretControlInterface interface { GetForCluster(cluster *v1alpha1.Cluster) (*v1.Secret, error) CreateSecret(s *v1.Secret) error }
SecretControlInterface defines the interface that the ClusterController uses to get and create Secrets. It is implemented as an interface to enable testing.
func NewRealSecretControl ¶
func NewRealSecretControl(client kubernetes.Interface) SecretControlInterface
NewRealSecretControl creates a concrete implementation of the SecretControlInterface.
type ServiceControlInterface ¶
ServiceControlInterface defines the interface that the ClusterController uses to create Services. It is implemented as an interface to enable testing.
func NewRealServiceControl ¶
func NewRealServiceControl(client kubernetes.Interface, serviceLister corelistersv1.ServiceLister) ServiceControlInterface
NewRealServiceControl creates a concrete implementation of the ServiceControlInterface.
type StatefulSetControlInterface ¶
type StatefulSetControlInterface interface { CreateStatefulSet(ss *apps.StatefulSet) error Patch(old *apps.StatefulSet, new *apps.StatefulSet) error }
StatefulSetControlInterface defines the interface that the ClusterController uses to create and update StatefulSets. It is implemented as an interface to enable testing.
func NewRealStatefulSetControl ¶
func NewRealStatefulSetControl(client kubernetes.Interface, statefulSetLister appslistersv1beta1.StatefulSetLister) StatefulSetControlInterface
NewRealStatefulSetControl creates a concrete implementation of the StatefulSetControlInterface.