deleter

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: Apache-2.0 Imports: 11 Imported by: 114

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deleter

type Deleter struct {
	*common.RuntimeConfig
	ProcTable ProcTable
}

Deleter handles PV cleanup and object deletion For file-based volumes, it deletes the contents of the directory

func NewDeleter

func NewDeleter(config *common.RuntimeConfig, procTable ProcTable) *Deleter

NewDeleter creates a Deleter object to handle the cleanup and deletion of local PVs allocated by this provisioner

func (*Deleter) DeletePVs

func (d *Deleter) DeletePVs()

DeletePVs will scan through all the existing PVs that are released, and cleanup and delete them

type FakeProcTableImpl

type FakeProcTableImpl struct {

	// IsRunningCount keeps count of number of times IsRunning() was called
	IsRunningCount int
	// MarkRunningCount keeps count of number of times MarkRunning() was called
	MarkRunningCount int
	// MarkDoneCount keeps count of number of times MarkDone() was called
	MarkDoneCount int
	// contains filtered or unexported fields
}

FakeProcTableImpl creates a mock proc table that enables testing.

func NewFakeProcTable

func NewFakeProcTable() *FakeProcTableImpl

NewFakeProcTable returns a BlockCleaner

func (*FakeProcTableImpl) IsEmpty

func (f *FakeProcTableImpl) IsEmpty() bool

IsEmpty Check if any cleanup process is running

func (*FakeProcTableImpl) IsRunning

func (f *FakeProcTableImpl) IsRunning(pvName string) bool

IsRunning Check if cleanup process is still running

func (*FakeProcTableImpl) MarkDone

func (f *FakeProcTableImpl) MarkDone(pvName string)

MarkDone Indicate the process is no longer running or being tracked.

func (*FakeProcTableImpl) MarkRunning

func (f *FakeProcTableImpl) MarkRunning(pvName string) error

MarkRunning Indicate that process is running.

type ProcEntry

type ProcEntry struct {
	StartTime time.Time
}

ProcEntry represents an entry in the proc table

type ProcTable

type ProcTable interface {
	// CleanupBlockPV deletes block based PV
	IsRunning(pvName string) bool
	IsEmpty() bool
	MarkRunning(pvName string) error
	MarkDone(pvName string)
}

ProcTable Interface for tracking running processes

type ProcTableImpl

type ProcTableImpl struct {
	// contains filtered or unexported fields
}

ProcTableImpl Implementation of BLockCleaner interface

func NewProcTable

func NewProcTable() *ProcTableImpl

NewProcTable returns a BlockCleaner

func (*ProcTableImpl) IsEmpty

func (v *ProcTableImpl) IsEmpty() bool

IsEmpty Check if any cleanup process is running

func (*ProcTableImpl) IsRunning

func (v *ProcTableImpl) IsRunning(pvName string) bool

IsRunning Check if cleanup process is still running

func (*ProcTableImpl) MarkDone

func (v *ProcTableImpl) MarkDone(pvName string)

MarkDone Indicate the process is no longer running or being tracked.

func (*ProcTableImpl) MarkRunning

func (v *ProcTableImpl) MarkRunning(pvName string) error

MarkRunning Indicate that process is running.

Jump to

Keyboard shortcuts

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