Documentation ¶
Index ¶
- Constants
- func CopyDir(source string, dest string) (err error)
- func CopyFile(src, dst string) error
- func GetAvailableSpace(path string) (int64, error)
- func GetAvailableSpaceBlock(deviceName string) (int64, error)
- func GetAvailableSpaceByVolumeMode(volumeMode v1.PersistentVolumeMode) (int64, error)
- func GetNamespace() string
- func GetRecommendedInstallerLabelsFromCr(cr *cdiv1.CDI) map[string]string
- func Md5sum(filePath string) (string, error)
- func MergeLabels(src, dest map[string]string) map[string]string
- func MinQuantity(availableSpace, imageSize *resource.Quantity) resource.Quantity
- func ParseEnvVar(envVarName string, decode bool) (string, error)
- func RandAlphaNum(n int) string
- func RoundDown(number, multiple int64) int64
- func RoundUp(number, multiple int64) int64
- func SetRecommendedLabels(obj metav1.Object, installerLabels map[string]string, controllerName string)
- func StreamDataToFile(r io.Reader, fileName string) error
- func UnArchiveTar(reader io.Reader, destDir string, arg ...string) error
- func WriteTerminationMessage(message string) error
- func WriteTerminationMessageToFile(file, message string) error
- type CountingReader
- type VddkInfo
Constants ¶
const (
// DefaultAlignBlockSize is the alignment size we use to align disk images, its a multiple of all known hardware block sizes 512/4k/8k/32k/64k.
DefaultAlignBlockSize = 1024 * 1024
)
Variables ¶
This section is empty.
Functions ¶
func GetAvailableSpace ¶ added in v1.4.0
GetAvailableSpace gets the amount of available space at the path specified.
func GetAvailableSpaceBlock ¶ added in v1.8.0
GetAvailableSpaceBlock gets the amount of available space at the block device path specified.
func GetAvailableSpaceByVolumeMode ¶ added in v1.8.0
func GetAvailableSpaceByVolumeMode(volumeMode v1.PersistentVolumeMode) (int64, error)
GetAvailableSpaceByVolumeMode calls another method based on the volumeMode parameter to get the amount of available space at the path specified.
func GetNamespace ¶
func GetNamespace() string
GetNamespace returns the namespace the pod is executing in
func GetRecommendedInstallerLabelsFromCr ¶ added in v1.38.0
GetRecommendedInstallerLabelsFromCr returns the recommended labels to set on CDI resources
func MergeLabels ¶ added in v1.38.0
MergeLabels adds source labels to destination (does not change existing ones)
func MinQuantity ¶ added in v1.4.0
MinQuantity calculates the minimum of two quantities.
func ParseEnvVar ¶ added in v1.4.0
ParseEnvVar provides a wrapper to attempt to fetch the specified env var
func RandAlphaNum ¶
RandAlphaNum provides an implementation to generate a random alpha numeric string of the specified length
func RoundDown ¶ added in v1.30.0
RoundDown returns the number rounded down to the nearest multiple.
func SetRecommendedLabels ¶ added in v1.38.0
func SetRecommendedLabels(obj metav1.Object, installerLabels map[string]string, controllerName string)
SetRecommendedLabels sets the recommended labels on CDI resources (does not get rid of existing ones)
func StreamDataToFile ¶ added in v1.9.0
StreamDataToFile provides a function to stream the specified io.Reader to the specified local file
func UnArchiveTar ¶ added in v1.5.0
UnArchiveTar unarchives a tar file and streams its files using the specified io.Reader to the specified destination.
func WriteTerminationMessage ¶ added in v1.10.0
WriteTerminationMessage writes the passed in message to the default termination message file
func WriteTerminationMessageToFile ¶ added in v1.10.0
WriteTerminationMessageToFile writes the passed in message to the passed in message file
Types ¶
type CountingReader ¶ added in v1.4.0
type CountingReader struct { Reader io.ReadCloser Current uint64 Done bool }
CountingReader is a reader that keeps track of how much has been read
func (*CountingReader) Close ¶ added in v1.4.0
func (r *CountingReader) Close() error
Close closes the stream