Documentation ¶
Index ¶
- Constants
- func NewDanglingError(msg string, node k8stypes.NodeName, devicePath string) error
- func RoundUpSize(volumeSizeBytes int64, allocationUnitBytes int64) int64
- func RoundUpSizeInt(volumeSizeBytes int64, allocationUnitBytes int64) (int, error)
- func RoundUpToGiBInt(size resource.Quantity) (int, error)
- type DanglingAttachError
Constants ¶
View Source
const (
GIB = 1024 * 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func NewDanglingError ¶
NewDanglingError create a new dangling error
func RoundUpSize ¶
RoundUpSize calculates how many allocation units are needed to accommodate a volume of given size. E.g. when user wants 1500MiB volume, while AWS EBS allocates volumes in gibibyte-sized chunks, RoundUpSize(1500 * 1024*1024, 1024*1024*1024) returns '2' (2 GiB is the smallest allocatable volume that can hold 1500MiB)
func RoundUpSizeInt ¶
RoundUpSizeInt calculates how many allocation units are needed to accommodate a volume of given size. It returns an int instead of an int64 and an error if there's overflow
Types ¶
type DanglingAttachError ¶
type DanglingAttachError struct { CurrentNode k8stypes.NodeName DevicePath string // contains filtered or unexported fields }
DanglingAttachError indicates volume is attached to a different node than we expected.
func (*DanglingAttachError) Error ¶
func (err *DanglingAttachError) Error() string
Click to show internal directories.
Click to hide internal directories.