Documentation
¶
Index ¶
- type MissingStorageClassError
- type PVCFitError
- type StorageCapacityInfo
- func (sc *StorageCapacityInfo) Allocatable() resource.Quantity
- func (sc *StorageCapacityInfo) ArePVCsAllocatable(pvcs []*storageclaim_info.StorageClaimInfo) error
- func (sc *StorageCapacityInfo) ArePVCsAllocatableOnReleasingOrIdle(pvcs []*storageclaim_info.StorageClaimInfo, ...) error
- func (sc *StorageCapacityInfo) Clone() *StorageCapacityInfo
- func (sc *StorageCapacityInfo) IsNodeValid(nodeLabels map[string]string) bool
- func (sc *StorageCapacityInfo) Releasing(podInfos map[common_info.PodID]*pod_info.PodInfo) resource.Quantity
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MissingStorageClassError ¶
type MissingStorageClassError struct {
// contains filtered or unexported fields
}
func NewMissingStorageClassError ¶
func NewMissingStorageClassError(storageClassName common_info.StorageClassID) *MissingStorageClassError
func (*MissingStorageClassError) Error ¶
func (sce *MissingStorageClassError) Error() string
type PVCFitError ¶
type PVCFitError struct {
// contains filtered or unexported fields
}
func (*PVCFitError) Error ¶
func (p *PVCFitError) Error() string
type StorageCapacityInfo ¶
type StorageCapacityInfo struct {
UID common_info.StorageCapacityID
Name string
// StorageClass is the name of the StorageClass that this capacity applies to.
StorageClass common_info.StorageClassID
// ProvisionedPVCs is a map of all existing PVCs provisioned from a node with access to this capacity and
// with matching StorageClass, and are reclaimable (owned by a single pod)
ProvisionedPVCs map[storageclaim_info.Key]*storageclaim_info.StorageClaimInfo
// MaximumVolumeSize is the largest size that may be used in a
// ResourceRequirements.Requests in a volume claim that uses this storage capacity.
MaximumVolumeSize *resource.Quantity
// contains filtered or unexported fields
}
func NewStorageCapacityInfo ¶
func NewStorageCapacityInfo(capacity *v1.CSIStorageCapacity) (*StorageCapacityInfo, error)
func (*StorageCapacityInfo) Allocatable ¶
func (sc *StorageCapacityInfo) Allocatable() resource.Quantity
Allocatable calculates the allocatable storage for the capacity. Generally, we assume that the allocatable capacity stated in the object is the allocatable. However, if we have virtually allocated pvcs on this capacity, the pvc object is still considered PENDING and not taken into account in StorageCapacityInfo.capacity. So we subtract all claims that are PENDING.
func (*StorageCapacityInfo) ArePVCsAllocatable ¶
func (sc *StorageCapacityInfo) ArePVCsAllocatable(pvcs []*storageclaim_info.StorageClaimInfo) error
ArePVCsAllocatable returns true if all unbound PVCs passed can be allocated together by this storage capacity, considering storage capacity and MaximumVolumeSize
func (*StorageCapacityInfo) ArePVCsAllocatableOnReleasingOrIdle ¶
func (sc *StorageCapacityInfo) ArePVCsAllocatableOnReleasingOrIdle(pvcs []*storageclaim_info.StorageClaimInfo, podInfos map[common_info.PodID]*pod_info.PodInfo) error
ArePVCsAllocatableOnReleasingOrIdle returns true if all unbound PVCs passed can be allocated together by this storage capacity, considering storage capacity, storage capacity of possibly releasing pvcs, and MaximumVolumeSize
func (*StorageCapacityInfo) Clone ¶
func (sc *StorageCapacityInfo) Clone() *StorageCapacityInfo
func (*StorageCapacityInfo) IsNodeValid ¶
func (sc *StorageCapacityInfo) IsNodeValid(nodeLabels map[string]string) bool
func (*StorageCapacityInfo) Releasing ¶
func (sc *StorageCapacityInfo) Releasing(podInfos map[common_info.PodID]*pod_info.PodInfo) resource.Quantity