controller

package
v0.0.0-...-cb5dd21 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2018 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// SuccessSynced is used as part of the Event 'reason' when a CassandraCluster is synced
	SuccessSynced = "Synced"
	// ErrResourceExists is used as part of the Event 'reason' when a CassandraCluster fails
	// to sync due to a Deployment of the same name already existing.
	ErrResourceExists = "ErrResourceExists"

	// MessageResourceExists is the message used for Events when a resource
	// fails to sync due to a Deployment already existing
	MessageResourceExists = "Resource %q already exists and is not managed by CassandraCluster"
	// MessageResourceSynced is the message used for an Event fired when a CassandraCluster
	// is synced successfully
	MessageResourceSynced = "CassandraCluster synced successfully"
)

Variables

This section is empty.

Functions

func GenerateToken

func GenerateToken(name string, cost int) string

GenerateToken returns a unique token based on the provided string

Types

type Controller

type Controller struct {
	CassandraClustersLister listers.CassandraClusterLister
	CassandraClustersSynced cache.InformerSynced
	// contains filtered or unexported fields
}

Controller is the controller implementation for CassandraCluster resources

func NewController

func NewController(
	config *rest.Config,
	kubeClientset kubernetes.Interface,
	namespace string,
	cassandraClusterClientset clientset.Interface,
	kubeInformerFactory kubeinformers.SharedInformerFactory,
	cassandraClusterInformerFactory informers.SharedInformerFactory) *Controller

NewController returns a new cassandraCluster controller

func (*Controller) BuildHeadlessService

func (c *Controller) BuildHeadlessService(cc *cassandrav1.CassandraCluster) *v1.Service

func (*Controller) BuildStatefulSet

func (c *Controller) BuildStatefulSet(cc *cassandrav1.CassandraCluster) *v1.StatefulSet

func (*Controller) CreateOrUpdateService

func (c *Controller) CreateOrUpdateService(cc *cassandrav1.CassandraCluster) error

func (*Controller) CreateOrUpdateStatefulSet

func (c *Controller) CreateOrUpdateStatefulSet(cc *cassandrav1.CassandraCluster) (bool, error)

func (*Controller) DeletePVC

func (c *Controller) DeletePVC(name string) error

func (*Controller) DeleteService

func (c *Controller) DeleteService(svcName string) error

func (*Controller) DeleteStatefulSet

func (c *Controller) DeleteStatefulSet(stsName string) error

func (*Controller) ExecCmd

func (c *Controller) ExecCmd(podName string, cmd []string) (string, string, error)

func (*Controller) Run

func (c *Controller) Run(threadiness int, stopCh <-chan struct{}) error

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.

func (*Controller) WaitForStatefulSet

func (c *Controller) WaitForStatefulSet(sts *v1.StatefulSet) error

query API server until the stateful set is completely deployed (use an exponential back off and a timeout)

Jump to

Keyboard shortcuts

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