Documentation ¶
Index ¶
- Constants
- func CheckForCStorVolumeCRD(clientset clientset.Interface)
- func IsDestroyEvent(cStorVolume *apis.CStorVolume) bool
- func IsOnlyStatusChange(oldCStorVolume, newCStorVolume *apis.CStorVolume) bool
- func IsValidCStorVolumeMgmt(cStorVolume *apis.CStorVolume) bool
- func StartControllers(kubeconfig string)
- type CStorVolumeController
- type CStorVolumeStatus
- type Environment
- type EventReason
- type QueueLoad
- type QueueOperation
Constants ¶
const ( // NumThreads defines number of worker threads for resource watcher. NumThreads = 1 // NumRoutinesThatFollow is for handling golang waitgroups. NumRoutinesThatFollow = 1 )
const ( // CStorVolume is the controller to be watched CStorVolume = "cStorVolume" // EventMsgFormatter is the format string for event message generation EventMsgFormatter = "Volume is in %s state" )
const ( // CRDRetryInterval is used if CRD is not present. CRDRetryInterval = 10 * time.Second // ResourceWorkerInterval is used for resource sync. ResourceWorkerInterval = time.Second )
const (
DefaultNameSpace namespace = "openebs"
)
Different types of k8s namespaces.
DefaultSharedInformerInterval is used to sync watcher controller.
Variables ¶
This section is empty.
Functions ¶
func CheckForCStorVolumeCRD ¶
CheckForCStorVolumeCRD is Blocking call for checking status of CStorVolume CRD.
func IsDestroyEvent ¶
func IsDestroyEvent(cStorVolume *apis.CStorVolume) bool
IsDestroyEvent is to check if the call is for cStorVolume destroy.
func IsOnlyStatusChange ¶
func IsOnlyStatusChange(oldCStorVolume, newCStorVolume *apis.CStorVolume) bool
IsOnlyStatusChange is to check only status change of cStorVolume object.
func IsValidCStorVolumeMgmt ¶
func IsValidCStorVolumeMgmt(cStorVolume *apis.CStorVolume) bool
IsValidCStorVolumeMgmt is to check if the volume request is for particular pod/application.
func StartControllers ¶
func StartControllers(kubeconfig string)
StartControllers instantiates CStorVolume controllers and watches them.
Types ¶
type CStorVolumeController ¶
type CStorVolumeController struct {
// contains filtered or unexported fields
}
CStorVolumeController is the controller implementation for CStorVolume resources.
func NewCStorVolumeController ¶
func NewCStorVolumeController( kubeclientset kubernetes.Interface, clientset clientset.Interface, kubeInformerFactory kubeinformers.SharedInformerFactory, cStorInformerFactory informers.SharedInformerFactory) *CStorVolumeController
NewCStorVolumeController returns a new instance of CStorVolume controller
func (*CStorVolumeController) Run ¶
func (c *CStorVolumeController) 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.
type CStorVolumeStatus ¶
type CStorVolumeStatus string
CStorVolumeStatus represents the status of a CStorVolume object
const ( // volume is getting initialized CVStatusInit CStorVolumeStatus = "Init" // volume allows IOs and snapshot CVStatusHealthy CStorVolumeStatus = "Healthy" // volume only satisfies consistency factor CVStatusDegraded CStorVolumeStatus = "Degraded" // Volume is offline CVStatusOffline CStorVolumeStatus = "Offline" // Error in retrieving volume details CVStatusError CStorVolumeStatus = "Error" // volume controller config generation failed due to invalid parameters CVStatusInvalid CStorVolumeStatus = "Invalid" // CR event ignored CVStatusIgnore CStorVolumeStatus = "Ignore" )
Status written onto CStorVolume objects.
type Environment ¶
type Environment string
Environment is for environment variables passed for cstor-volume-mgmt.
const ( // OpenEBSIOCStorVolumeID is the environment variable specified in pod. OpenEBSIOCStorVolumeID Environment = "OPENEBS_IO_CSTOR_VOLUME_ID" )
type EventReason ¶
type EventReason string
EventReason is used as part of the Event reason when a resource goes through different phases
const ( // SuccessSynced is used as part of the Event 'reason' when a resource is synced SuccessSynced EventReason = "Synced" // MessageCreateSynced holds message for corresponding create request sync. MessageCreateSynced EventReason = "Received Resource create event" // MessageModifySynced holds message for corresponding modify request sync. MessageModifySynced EventReason = "Received Resource modify event" // MessageDestroySynced holds message for corresponding destroy request sync. MessageDestroySynced EventReason = "Received Resource destroy event" // SuccessCreated holds status for corresponding created resource. SuccessCreated EventReason = "Created" // MessageResourceCreated holds message for corresponding created resource. MessageResourceCreated EventReason = "Resource created successfully" // FailureCreate holds status for corresponding failed create resource. FailureCreate EventReason = "FailCreate" // MessageResourceFailCreate holds message for corresponding failed create resource. MessageResourceFailCreate EventReason = "Resource creation failed" // FailureUpdate holds status for corresponding failed update resource. FailureUpdate EventReason = "FailUpdate" // SuccessImported holds status for corresponding imported resource. SuccessImported EventReason = "Imported" // MessageResourceImported holds message for corresponding imported resource. MessageResourceImported EventReason = "Resource imported successfully" // FailureImport holds status for corresponding failed import resource. FailureImport EventReason = "FailImport" // MessageResourceFailImport holds message for corresponding failed import resource. MessageResourceFailImport EventReason = "Resource import failed" // FailureDestroy holds status for corresponding failed destroy resource. FailureDestroy EventReason = "FailDestroy" // MessageResourceFailDestroy holds message for corresponding failed destroy resource. MessageResourceFailDestroy EventReason = "Resource Destroy failed" // FailureValidate holds status for corresponding failed validate resource. FailureValidate EventReason = "FailValidate" // MessageResourceFailValidate holds message for corresponding failed validate resource. MessageResourceFailValidate EventReason = "Resource validation failed" // AlreadyPresent holds status for corresponding already present resource. AlreadyPresent EventReason = "AlreadyPresent" // MessageResourceAlreadyPresent holds message for corresponding already present resource. MessageResourceAlreadyPresent EventReason = "Resource already present" // SuccessUpdated holds status for corresponding updated resource. SuccessUpdated EventReason = "Updated" // MessageResourceUpdated holds message for corresponding updated resource. MessageResourceUpdated EventReason = "Resource updated successfully" )
type QueueLoad ¶
type QueueLoad struct { Key string // Key is the name of cstor volume given in metadata name field in the yaml Operation QueueOperation }
QueueLoad is for storing the key and type of operation before entering workqueue
type QueueOperation ¶
type QueueOperation string
QueueOperation represents the type of operation on resource
const ( QOpAdd QueueOperation = "add" QOpDestroy QueueOperation = "destroy" QOpModify QueueOperation = "modify" QOpPeriodicSync QueueOperation = "sync" )
Different type of operations on the controller