Documentation
¶
Index ¶
- func CompareWithCheckFn(claim, template *v1.PersistentVolumeClaim, cmp CheckClaimFn) (matched, cmpResult bool)
- func IsClaimCompatibleWithoutSize(claim, template *v1.PersistentVolumeClaim) bool
- func IsPVCCompatibleAndReady(claim, template *v1.PersistentVolumeClaim) (compatible bool, ready bool)
- func IsPVCNeedExpand(claim, template *v1.PersistentVolumeClaim) bool
- func IsPatchPVCCompleted(claim, template *v1.PersistentVolumeClaim) bool
- type CheckClaimFn
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareWithCheckFn ¶
func CompareWithCheckFn(claim, template *v1.PersistentVolumeClaim, cmp CheckClaimFn) (matched, cmpResult bool)
CompareWithCheckFn compares a PersistentVolumeClaim with a template claim using a custom comparison function. This function first checks if the claim is compatible with the template claim excluding size considerations. If the claim is compatible, it then uses the provided CheckClaimFn function to perform a detailed comparison. The function returns two boolean values: the first indicates whether the claim matches the template, and the second provides the result of the custom comparison function.
Parameters: claim: The PersistentVolumeClaim to be compared. template: The template PersistentVolumeClaim to compare against. cmp: A CheckClaimFn function used for detailed comparison.
Return values: matched: Indicates whether the claim matches the template (true if it matches, false otherwise). cmpResult: The result of the custom comparison function (true if the function returns true, false otherwise).
func IsClaimCompatibleWithoutSize ¶
func IsClaimCompatibleWithoutSize(claim, template *v1.PersistentVolumeClaim) bool
IsClaimCompatibleWithoutSize PersistentVolumeClaim Compare function
func IsPVCCompatibleAndReady ¶
func IsPVCCompatibleAndReady(claim, template *v1.PersistentVolumeClaim) (compatible bool, ready bool)
func IsPVCNeedExpand ¶
func IsPVCNeedExpand(claim, template *v1.PersistentVolumeClaim) bool
IsPVCNeedExpand checks if the given PersistentVolumeClaim (PVC) has expanded based on a template. Parameters:
claim: The PVC object to be inspected. template: The PVC template object for comparison.
Return:
A boolean indicating whether the PVC has expanded beyond the template's definitions in terms of storage requests or limits.
This function determines if the PVC has expanded by comparing the storage requests and limits between the PVC and the template. If either the storage request of the PVC exceeds that defined in the template, it is considered expanded.
func IsPatchPVCCompleted ¶
func IsPatchPVCCompleted(claim, template *v1.PersistentVolumeClaim) bool
IsPatchPVCCompleted PersistentVolumeClaim Compare function
Types ¶
type CheckClaimFn ¶
type CheckClaimFn = func(*v1.PersistentVolumeClaim, *v1.PersistentVolumeClaim) bool