Documentation
¶
Index ¶
- Constants
- func CheckAndDeleteStaleFile(dirPath, fileName string) error
- func ConvertLabelsStringToMap(labels string) (map[string]string, error)
- func GetSocketBasePath(targetPath, fuseSocketDir string) string
- func ParseEndpoint(endpoint string, cleanupSocket bool) (string, string, error)
- func ParsePodIDVolumeFromTargetpath(targetPath string) (string, string, error)
- func PrepareEmptyDir(targetPath string, createEmptyDir bool) (string, error)
- func RecvMsg(via net.Conn) (int, []byte, error)
- func SendMsg(via net.Conn, fd int, msg []byte) error
- type VolumeLocks
- type VolumeState
- type VolumeStateStore
Constants ¶
const ( Mb = 1024 * 1024 TrueStr = "true" FalseStr = "false" // mount options that both CSI mounter and sidecar mounter should understand. DisableMetricsForGKE = "disable-metrics-for-gke" )
const (
VolumeOperationAlreadyExistsFmt = "An operation with the given volume key %s already exists"
)
Variables ¶
This section is empty.
Functions ¶
func CheckAndDeleteStaleFile ¶ added in v1.14.4
func ConvertLabelsStringToMap ¶
ConvertLabelsStringToMap converts the labels from string to map example: "key1=value1,key2=value2" gets converted into {"key1": "value1", "key2": "value2"}
func GetSocketBasePath ¶ added in v1.6.0
GetSocketBasePath constructs the base path for a Unix domain socket. It takes the target path and the directory where Fuse sockets are stored as input.
func ParseEndpoint ¶
Types ¶
type VolumeLocks ¶
type VolumeLocks struct {
// contains filtered or unexported fields
}
VolumeLocks implements a map with atomic operations. It stores a set of all volume IDs with an ongoing operation.
func NewVolumeLocks ¶
func NewVolumeLocks() *VolumeLocks
func (*VolumeLocks) Release ¶
func (vl *VolumeLocks) Release(volumeID string)
func (*VolumeLocks) TryAcquire ¶
func (vl *VolumeLocks) TryAcquire(volumeID string) bool
TryAcquire tries to acquire the lock for operating on volumeID and returns true if successful. If another operation is already using volumeID, returns false.
type VolumeState ¶ added in v1.13.0
type VolumeState struct {
BucketAccessCheckPassed bool
}
type VolumeStateStore ¶ added in v1.13.0
type VolumeStateStore struct {
// contains filtered or unexported fields
}
VolumeStateStore provides a thread-safe map for storing volume states.
func NewVolumeStateStore ¶ added in v1.13.0
func NewVolumeStateStore() *VolumeStateStore
NewVolumeStateStore initializes the volume state store.
func (*VolumeStateStore) Delete ¶ added in v1.13.0
func (vss *VolumeStateStore) Delete(volumeID string)
Delete removes a volume from the store.
func (*VolumeStateStore) Load ¶ added in v1.13.0
func (vss *VolumeStateStore) Load(volumeID string) (*VolumeState, bool)
Load retrieves the state of a volume.
func (*VolumeStateStore) Size ¶ added in v1.13.0
func (vss *VolumeStateStore) Size() int32
NewVolumeStateStore initializes the volume state store.
func (*VolumeStateStore) Store ¶ added in v1.13.0
func (vss *VolumeStateStore) Store(volumeID string, state *VolumeState)
Store adds or updates a volume state.