Documentation ¶
Index ¶
- Constants
- Variables
- func BaseLabels(cvc *apis.CStorVolumeConfig) map[string]string
- func GetCVRList(clientset clientset.Interface, pvName, namespace string) (*apis.CStorVolumeReplicaList, error)
- func GetPDBLabelSelector(poolNames []string) string
- func GetPDBLabels(poolNames []string, cspcName string) map[string]string
- func GetPDBPoolLabels(poolNames []string) map[string]string
- func GetVolumeReplicaPoolNames(clientset clientset.Interface, pvName, namespace string) ([]string, error)
- func MergeResizeConditionsOfCVC(oldConditions, resizeConditions []apis.CStorVolumeConfigCondition) []apis.CStorVolumeConfigCondition
- func Start() error
- type CVCController
- func (c *CVCController) BuildTargetDeployment(vol *apis.CStorVolume, policySpec *apis.CStorVolumePolicySpec) (*appsv1.Deployment, error)
- func (c *CVCController) IsCVRPending(cvc *apis.CStorVolumeConfig) (bool, error)
- func (c *CVCController) PatchCVCStatus(oldCVC, newCVC *apis.CStorVolumeConfig) (*apis.CStorVolumeConfig, error)
- func (c *CVCController) Run(threadiness int, stopCh <-chan struct{})
- func (c *CVCController) ShouldReconcile(cvc *apis.CStorVolumeConfig) (bool, string)
- type CVCControllerBuilder
- type Patch
Constants ¶
const ( // SuccessSynced is used as part of the Event 'reason' when a // cstorvolumeconfig is synced SuccessSynced = "Synced" // Provisioning is used as part of the Event 'reason' when a // cstorvolumeconfig is in provisioning stage Provisioning = "Provisioning" // ErrResourceExists is used as part of the Event 'reason' when a // cstorvolumeconfig fails to sync due to a cstorvolumeconfig of the same // name already existing. ErrResourceExists = "ErrResourceExists" // MessageResourceExists is the message used for Events when a resource // fails to sync due to a cstorvolumeconfig already existing MessageResourceExists = "Resource %q already exists and is not managed by CVC" // MessageResourceSynced is the message used for an Event fired when a // cstorvolumeconfig is synced successfully MessageResourceSynced = "cstorvolumeconfig synced successfully" // MessageResourceCreated msg used for cstor volume provisioning success event MessageResourceCreated = "cstorvolumeconfig created successfully" // MessageCVCPublished msg used for cstor volume provisioning publish events MessageCVCPublished = "cstorvolumeconfig %q must be published/attached on node" // CStorVolumeConfigFinalizer name of finalizer on CStorVolumeConfig that // are bound by CStorVolume CStorVolumeConfigFinalizer = "cvc.openebs.io/finalizer" // DeProvisioning is used as part of the event 'reason' during // cstorvolumeconfig deprovisioning stage DeProvisioning = "DeProvisioning" )
const (
// ReplicaCount represents replica count value
ReplicaCount = "replicaCount"
)
Variables ¶
var ( // TargetContainerName is the name of cstor target container name TargetContainerName = "cstor-istgt" // MonitorContainerName is the name of monitor container name MonitorContainerName = "maya-volume-exporter" // MgmtContainerName is the container name of cstor volume mgmt side car MgmtContainerName = "cstor-volume-mgmt" )
Functions ¶
func BaseLabels ¶
func BaseLabels(cvc *apis.CStorVolumeConfig) map[string]string
BaseLabels returns the base labels we apply to cstorvolumereplicas created
func GetCVRList ¶
func GetCVRList(clientset clientset.Interface, pvName, namespace string) (*apis.CStorVolumeReplicaList, error)
GetCVRList returns list of volume replicas related to provided volume
func GetPDBLabelSelector ¶
GetPDBLabelSelector returns the labelSelector to list the PDB
func GetPDBLabels ¶
GetPDBLabels returns the labels required for building PDB based on arguments
func GetPDBPoolLabels ¶
GetPDBPoolLabels returns the pool labels from poolNames
func GetVolumeReplicaPoolNames ¶
func GetVolumeReplicaPoolNames(clientset clientset.Interface, pvName, namespace string) ([]string, error)
GetVolumeReplicaPoolNames return list of replicas pool names by taking pvName and namespace(where pool is installed) as a input and return error(if any error occured)
func MergeResizeConditionsOfCVC ¶
func MergeResizeConditionsOfCVC(oldConditions, resizeConditions []apis.CStorVolumeConfigCondition) []apis.CStorVolumeConfigCondition
MergeResizeConditionsOfCVC updates cvc with desired resize conditions leaving other conditions untouched.
Types ¶
type CVCController ¶
type CVCController struct {
// contains filtered or unexported fields
}
CVCController is the controller implementation for CVC resources
func (*CVCController) BuildTargetDeployment ¶
func (c *CVCController) BuildTargetDeployment( vol *apis.CStorVolume, policySpec *apis.CStorVolumePolicySpec, ) (*appsv1.Deployment, error)
BuildTargetDeployment builds the target deploytment object for a given volume and policy
func (*CVCController) IsCVRPending ¶
func (c *CVCController) IsCVRPending(cvc *apis.CStorVolumeConfig) (bool, error)
IsCVRPending look for pending cstorvolume replicas compared to desired replica count. returns true if count doesn't matches.
func (*CVCController) PatchCVCStatus ¶
func (c *CVCController) PatchCVCStatus(oldCVC, newCVC *apis.CStorVolumeConfig, ) (*apis.CStorVolumeConfig, error)
PatchCVCStatus updates CVC status using patch api
func (*CVCController) Run ¶
func (c *CVCController) Run(threadiness int, stopCh <-chan struct{})
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 (*CVCController) ShouldReconcile ¶
func (c *CVCController) ShouldReconcile(cvc *apis.CStorVolumeConfig) (bool, string)
type CVCControllerBuilder ¶
type CVCControllerBuilder struct {
CVCController *CVCController
}
CVCControllerBuilder is the builder object for controller.
func NewCVCControllerBuilder ¶
func NewCVCControllerBuilder() *CVCControllerBuilder
NewCVCControllerBuilder returns an empty instance of controller builder.
func (*CVCControllerBuilder) Build ¶
func (cb *CVCControllerBuilder) Build() (*CVCController, error)
Build returns a controller instance.