Documentation ¶
Index ¶
- Constants
- func BytesToGiB(volumeSizeBytes int64) int64
- func CleanupMountPoint(mountPath string, mounter mount.Interface, extensiveMountPointCheck bool) error
- func GetK8sNamespace() string
- func GiBToBytes(volumeSizeGiB int64) int64
- func IsCorruptedMnt(err error) bool
- func NewK8sClient() *k8s.Clientset
- func PathExists(path string) (bool, error)
- func RoundUpBytes(volumeSizeBytes int64) int64
- func RoundUpGiB(volumeSizeBytes int64) int64
- type CacheEntryNotFound
- type CachePersister
- type ForAllFunc
- type Idempotent
- type K8sCMCache
- type RequestItem
Constants ¶
const (
GiB = 1024 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func CleanupMountPoint ¶
func CleanupMountPoint(mountPath string, mounter mount.Interface, extensiveMountPointCheck bool) error
CleanupMountPoint unmounts the given path and deletes the remaining directory if successful. if extensiveMountPointCheck is true IsNotMountPoint will be called instead of IsLikelyNotMountPoint. IsNotMountPoint is more expensive but properly handles bind mounts within the same fs.
func GetK8sNamespace ¶
func GetK8sNamespace() string
GetK8sNamespace returns pod namespace. if pod namespace is empty it returns default namespace
func IsCorruptedMnt ¶
IsCorruptedMnt return true if err is about corrupted mount point
func PathExists ¶
TODO: clean this up to use pkg/util/file/FileExists PathExists returns true if the specified path exists.
func RoundUpBytes ¶
RoundUpBytes rounds up the volume size in bytes upto multiplications of GiB in the unit of Bytes
func RoundUpGiB ¶
RoundUpGiB rounds up the volume size in bytes upto multiplications of GiB in the unit of GiB
Types ¶
type CacheEntryNotFound ¶
type CacheEntryNotFound struct {
// contains filtered or unexported fields
}
CacheEntryNotFound is an error type for "Not Found" cache errors
type CachePersister ¶
type CachePersister interface { Create(identifier string, data interface{}) error Get(identifier string, data interface{}) error ForAll(pattern string, destObj interface{}, f ForAllFunc) error Delete(identifier string) error }
CachePersister interface implemented for store
func NewCachePersister ¶
func NewCachePersister() CachePersister
NewCachePersister returns K8sCachePersister
type ForAllFunc ¶
ForAllFunc is a unary predicate for visiting all cache entries matching the `pattern' in CachePersister's ForAll function.
type Idempotent ¶
type Idempotent struct {
// contains filtered or unexported fields
}
Idempotent is a struct used to manage in flight requests.
func NewIdempotent ¶
func NewIdempotent() *Idempotent
NewIdempotent instanciates a Idempotent structures.
func (*Idempotent) Delete ¶
func (idem *Idempotent) Delete(h RequestItem)
func (*Idempotent) Insert ¶
func (idem *Idempotent) Insert(entry RequestItem) bool
type K8sCMCache ¶
K8sCMCache to store metadata
func (*K8sCMCache) Create ¶
func (k8scm *K8sCMCache) Create(identifier string, data interface{}) error
Create stores the metadata in configmaps with identifier name
func (*K8sCMCache) Delete ¶
func (k8scm *K8sCMCache) Delete(identifier string) error
Delete deletes the metadata in configmaps with identifier name
func (*K8sCMCache) ForAll ¶
func (k8scm *K8sCMCache) ForAll(pattern string, destObj interface{}, f ForAllFunc) error
ForAll list the metadata in configmaps and filters outs based on the pattern
func (*K8sCMCache) Get ¶
func (k8scm *K8sCMCache) Get(identifier string, data interface{}) error
Get retrieves the metadata in configmaps with identifier name
type RequestItem ¶
type RequestItem interface { // The CSI data types are generated using a protobuf. // The generated structures are guaranteed to implement the Stringer interface. // Example: https://github.com/container-storage-interface/spec/blob/master/lib/go/csi/csi.pb.go#L3508 // We can use the generated string as the key of our internal inflight database of requests. String() string }
RequestItem is the interface required to manage in flight requests.