Documentation ¶
Index ¶
- Constants
- func ChooseZonesForVolume(zones sets.String, pvcName string, numZones uint32) sets.String
- func LabelZonesToList(labelZonesValue string) ([]string, error)
- func LabelZonesToSet(labelZonesValue string) (sets.String, error)
- func RoundUpToGiB(size resource.Quantity) (int64, error)
- func RoundUpToGiBInt(size resource.Quantity) (int, error)
- func RoundUpToGiBInt32(size resource.Quantity) (int32, error)
- func RoundUpToKB(size resource.Quantity) (int64, error)
- func RoundUpToKBInt(size resource.Quantity) (int, error)
- func RoundUpToKiB(size resource.Quantity) (int64, error)
- func RoundUpToKiBInt(size resource.Quantity) (int, error)
- func RoundUpToMB(size resource.Quantity) (int64, error)
- func RoundUpToMBInt(size resource.Quantity) (int, error)
- func RoundUpToMiB(size resource.Quantity) (int64, error)
- func RoundUpToMiBInt(size resource.Quantity) (int, error)
- func SelectZoneForVolume(zoneParameterPresent, zonesParameterPresent bool, zoneParameter string, ...) (string, error)
- func SelectZonesForVolume(zoneParameterPresent, zonesParameterPresent bool, zoneParameter string, ...) (sets.String, error)
- func ZonesFromAllowedTopologies(allowedTopologies []v1.TopologySelectorTerm) (sets.String, error)
- func ZonesSetToLabelValue(strSet sets.String) string
- func ZonesToSet(zonesString string) (sets.String, error)
Constants ¶
const ( // GB - GigaByte size GB = 1000 * 1000 * 1000 // GiB - GibiByte size GiB = 1024 * 1024 * 1024 // MB - MegaByte size MB = 1000 * 1000 // MiB - MebiByte size MiB = 1024 * 1024 // KB - KiloByte size KB = 1000 // KiB - KibiByte size KiB = 1024 )
Variables ¶
This section is empty.
Functions ¶
func ChooseZonesForVolume ¶
ChooseZonesForVolume is identical to ChooseZoneForVolume, but selects a multiple zones, for multi-zone disks.
func LabelZonesToList ¶
LabelZonesToList converts a PV label value from string containing a delimited list of zones to list
func LabelZonesToSet ¶
LabelZonesToSet converts a PV label value from string containing a delimited list of zones to set
func RoundUpToGiB ¶
RoundUpToGiB rounds up given quantity upto chunks of GiB
func RoundUpToGiBInt ¶
RoundUpToGiBInt rounds up given quantity upto chunks of GiB. It returns an int instead of an int64 and an error if there's overflow
func RoundUpToGiBInt32 ¶
RoundUpToGiBInt32 rounds up given quantity up to chunks of GiB. It returns an int32 instead of an int64 and an error if there's overflow
func RoundUpToKB ¶
RoundUpToKB rounds up given quantity to chunks of KB
func RoundUpToKBInt ¶
RoundUpToKBInt rounds up given quantity to chunks of KB. It returns an int instead of an int64 and an error if there's overflow
func RoundUpToKiB ¶
RoundUpToKiB rounds up given quantity upto chunks of KiB
func RoundUpToKiBInt ¶
RoundUpToKiBInt rounds up given quantity upto chunks of KiB. It returns an int instead of an int64 and an error if there's overflow
func RoundUpToMB ¶
RoundUpToMB rounds up given quantity to chunks of MB
func RoundUpToMBInt ¶
RoundUpToMBInt rounds up given quantity to chunks of MB. It returns an int instead of an int64 and an error if there's overflow
func RoundUpToMiB ¶
RoundUpToMiB rounds up given quantity upto chunks of MiB
func RoundUpToMiBInt ¶
RoundUpToMiBInt rounds up given quantity upto chunks of MiB. It returns an int instead of an int64 and an error if there's overflow
func SelectZoneForVolume ¶
func SelectZoneForVolume(zoneParameterPresent, zonesParameterPresent bool, zoneParameter string, zonesParameter, zonesWithNodes sets.String, node *v1.Node, allowedTopologies []v1.TopologySelectorTerm, pvcName string) (string, error)
SelectZoneForVolume is a wrapper around SelectZonesForVolume to select a single zone for a volume based on parameters
func SelectZonesForVolume ¶
func SelectZonesForVolume(zoneParameterPresent, zonesParameterPresent bool, zoneParameter string, zonesParameter, zonesWithNodes sets.String, node *v1.Node, allowedTopologies []v1.TopologySelectorTerm, pvcName string, numReplicas uint32) (sets.String, error)
SelectZonesForVolume selects zones for a volume based on several factors: node.zone, allowedTopologies, zone/zones parameters from storageclass, zones with active nodes from the cluster. The number of zones = replicas.
func ZonesFromAllowedTopologies ¶
func ZonesFromAllowedTopologies(allowedTopologies []v1.TopologySelectorTerm) (sets.String, error)
ZonesFromAllowedTopologies returns a list of zones specified in allowedTopologies
func ZonesSetToLabelValue ¶
ZonesSetToLabelValue converts zones set to label value
Types ¶
This section is empty.