Documentation ¶
Overview ¶
Package modify contains claim resource controller definitions and synchronization functions
Package modify contains claim resource controller definitions and synchronization functions ¶
Package modify contains claim resource controller definitions and synchronization functions ¶
Package modify contains claim and content controller
Index ¶
- Constants
- func ClientOfModify(modifyClient drcsi.ModifyVolumeInterfaceClient) func(controller *VolumeModifyController)
- func Provisioner(provisioner string) func(controller *VolumeModifyController)
- func ReSyncPeriod(reSyncPeriod time.Duration) func(controller *VolumeModifyController)
- func ReconcileClaimStatusDelay(reconcileClaimStatusDelay time.Duration) func(controller *VolumeModifyController)
- func RetryBaseDelay(retryBaseDelay time.Duration) func(controller *VolumeModifyController)
- func RetryMaxDelay(retryMaxDelay time.Duration) func(controller *VolumeModifyController)
- func SyncFunc(sync syncObjectFunc) func(*ObjectWorker)
- func WorkerThreads(workerThreads int) func(controller *VolumeModifyController)
- type ObjectWorker
- type VolumeModifyController
Constants ¶
const ( // ProtectClaimFinalizer name of finalizer on VolumeModifyClaim when be created ProtectClaimFinalizer = "modify.xuanwu.huawei.io/volumemodifyclaim-protection" // SourceStorageClassKind source kind of StorageClass SourceStorageClassKind = "StorageClass" // HyperMetroFeatures hyperMetro features HyperMetroFeatures = "hyperMetro" // CreateFailedReason reason of created claim failed CreateFailedReason = "CreatingFailed" // StartCreatingContentReason reason of claim is creating StartCreatingContentReason = "CreatingContent" // ReCreatingScReason reason of storageclass is recreating ReCreatingScReason = "RecreatingStorageClass" // ContentReclaimPolicyKey content reclaim policy ContentReclaimPolicyKey = "modify.xuanwu.io/reclaimPolicy" // ContentDeletePolicy delete content reclaim policy ContentDeletePolicy = "delete" // ContentRollbackPolicy rollback content reclaim policy ContentRollbackPolicy = "rollback" )
const ( // ProtectContentFinalizer name of finalizer on VolumeModifyContent when be created ProtectContentFinalizer = "modify.xuanwu.huawei.io/volumemodifycontent-protection" // UpdateRetryTimes retry times UpdateRetryTimes = 10 // UpdateRetryDelay retry delay UpdateRetryDelay = 100 * time.Millisecond )
Variables ¶
This section is empty.
Functions ¶
func ClientOfModify ¶
func ClientOfModify(modifyClient drcsi.ModifyVolumeInterfaceClient) func(controller *VolumeModifyController)
ClientOfModify used to configure the modify client.
func Provisioner ¶
func Provisioner(provisioner string) func(controller *VolumeModifyController)
Provisioner used to configure the driver name.
func ReSyncPeriod ¶
func ReSyncPeriod(reSyncPeriod time.Duration) func(controller *VolumeModifyController)
ReSyncPeriod used to configure re-sync period.
func ReconcileClaimStatusDelay ¶
func ReconcileClaimStatusDelay(reconcileClaimStatusDelay time.Duration) func(controller *VolumeModifyController)
ReconcileClaimStatusDelay used to configure the interval of reconcile claim status.
func RetryBaseDelay ¶
func RetryBaseDelay(retryBaseDelay time.Duration) func(controller *VolumeModifyController)
RetryBaseDelay used to configure the start interval of retry.
func RetryMaxDelay ¶
func RetryMaxDelay(retryMaxDelay time.Duration) func(controller *VolumeModifyController)
RetryMaxDelay used to configure the max interval of retry.
func SyncFunc ¶
func SyncFunc(sync syncObjectFunc) func(*ObjectWorker)
SyncFunc is the configuration of sync function for queue of object. If set, this function will be called when object popping. If not set, do-nothings.
func WorkerThreads ¶
func WorkerThreads(workerThreads int) func(controller *VolumeModifyController)
WorkerThreads used to configure the number of working threads.
Types ¶
type ObjectWorker ¶
type ObjectWorker struct {
// contains filtered or unexported fields
}
ObjectWorker defines the object worker
func NewObjectWorker ¶
func NewObjectWorker(name string, queue workqueue.RateLimitingInterface, options ...func(*ObjectWorker)) *ObjectWorker
NewObjectWorker return a new ObjectWorker
func (*ObjectWorker) Run ¶
func (h *ObjectWorker) Run(ctx context.Context)
Run is a long-running function that will continually call the processNextWorkItem function in order to read and process a message on the work queue.
func (*ObjectWorker) SyncHandler ¶
func (h *ObjectWorker) SyncHandler(ctx context.Context, obj interface{}) error
SyncHandler passing it the namespace/name string of the resource to be synced.
type VolumeModifyController ¶
type VolumeModifyController struct {
// contains filtered or unexported fields
}
VolumeModifyController controller of volume modify
func NewVolumeModifyController ¶
func NewVolumeModifyController(ctx context.Context, client kubernetes.Interface, clientSet clientset.Interface, factory external.SharedInformerFactory, options ...func(controller *VolumeModifyController)) *VolumeModifyController
NewVolumeModifyController instance a controller
func (*VolumeModifyController) AddClaimHandler ¶
func (ctrl *VolumeModifyController) AddClaimHandler(ctx context.Context) *VolumeModifyController
AddClaimHandler add claim event handler
func (*VolumeModifyController) AddContentHandler ¶
func (ctrl *VolumeModifyController) AddContentHandler(ctx context.Context) *VolumeModifyController
AddContentHandler add claim event handler
func (*VolumeModifyController) Run ¶
func (ctrl *VolumeModifyController) Run(ctx context.Context, stopCh <-chan struct{})
Run will sync informer caches and starting workers. It will block until stopCh is closed