Documentation ¶
Index ¶
- Constants
- Variables
- func GetObjectKey(obj interface{}) (string, error)
- func GetPVCPatchData(oldPVC, newPVC *v1.PersistentVolumeClaim, addResourceVersionCheck bool) ([]byte, error)
- func GetPatchData(oldObj, newObj interface{}) ([]byte, error)
- func HasFileSystemResizePendingCondition(pvc *v1.PersistentVolumeClaim) bool
- func IsDelayRetryError(err error) bool
- func IsFinalError(err error) bool
- func IsInfeasibleError(err error) bool
- func MergeModifyVolumeConditionsOfPVC(oldConditions, newConditions []v1.PersistentVolumeClaimCondition) []v1.PersistentVolumeClaimCondition
- func MergeResizeConditionsOfPVC(oldConditions, newConditions []v1.PersistentVolumeClaimCondition, ...) []v1.PersistentVolumeClaimCondition
- func PatchClaim(kubeClient kubernetes.Interface, oldPVC, newPVC *v1.PersistentVolumeClaim, ...) (*v1.PersistentVolumeClaim, error)
- func PatchPersistentVolume(kubeClient kubernetes.Interface, oldPV, newPV *v1.PersistentVolume) (*v1.PersistentVolume, error)
- func SanitizeName(name string) string
- type DelayRetryError
- type SlowSet
Constants ¶
const ( VolumeResizing = "Resizing" VolumeResizeFailed = "VolumeResizeFailed" VolumeResizeSuccess = "VolumeResizeSuccessful" VolumeModify = "VolumeModify" VolumeModifyFailed = "VolumeModifyFailed" VolumeModifySuccess = "VolumeModifySuccessful" FileSystemResizeRequired = "FileSystemResizeRequired" )
These constants are PVC condition types related to resize operation.
const ( // If CSI migration is enabled, the value will be CSI driver name // Otherwise, it will be in-tree storage plugin name VolumeResizerKey = "volume.kubernetes.io/storage-resizer" )
Variables ¶
var ( // AnnPreResizeCapacity annotation is added to a PV when expanding volume. // Its value is status capacity of the PVC prior to the volume expansion // Its value will be set by the external-resizer when it deems that filesystem resize is required after resizing volume. // Its value will be used by pv_controller to determine pvc's status capacity when binding pvc and pv. AnnPreResizeCapacity = "volume.alpha.kubernetes.io/pre-resize-capacity" )
Functions ¶
func GetObjectKey ¶ added in v1.10.0
func GetPVCPatchData ¶ added in v1.0.0
func GetPVCPatchData(oldPVC, newPVC *v1.PersistentVolumeClaim, addResourceVersionCheck bool) ([]byte, error)
func GetPatchData ¶ added in v1.0.0
func HasFileSystemResizePendingCondition ¶
func HasFileSystemResizePendingCondition(pvc *v1.PersistentVolumeClaim) bool
HasFileSystemResizePendingCondition returns true if a pvc has a FileSystemResizePending condition. This means the controller side resize operation is finished, and kubelet side operation is in progress.
func IsDelayRetryError ¶ added in v1.12.0
func IsFinalError ¶ added in v1.10.0
func IsInfeasibleError ¶ added in v1.12.0
IsInfeasibleError returns true for grpc errors that are considered terminal in a way that they indicate CSI operation as infeasible. This function is a subset of final errors. All infeasible errors are also final errors
func MergeModifyVolumeConditionsOfPVC ¶ added in v1.10.0
func MergeModifyVolumeConditionsOfPVC(oldConditions, newConditions []v1.PersistentVolumeClaimCondition) []v1.PersistentVolumeClaimCondition
MergeModifyVolumeConditionsOfPVC updates pvc with requested modify volume conditions leaving other conditions untouched.
func MergeResizeConditionsOfPVC ¶
func MergeResizeConditionsOfPVC(oldConditions, newConditions []v1.PersistentVolumeClaimCondition, keepOldResizeConditions bool) []v1.PersistentVolumeClaimCondition
MergeResizeConditionsOfPVC updates pvc with requested resize conditions leaving other conditions untouched.
func PatchClaim ¶ added in v1.10.0
func PatchClaim(kubeClient kubernetes.Interface, oldPVC, newPVC *v1.PersistentVolumeClaim, addResourceVersionCheck bool) (*v1.PersistentVolumeClaim, error)
Patches a given PVC with changes from newPVC. If addResourceVersionCheck is true then a version check is added to the patch to ensure that we are not patching old(and possibly outdated) PVC objects.
func PatchPersistentVolume ¶ added in v1.10.0
func PatchPersistentVolume(kubeClient kubernetes.Interface, oldPV, newPV *v1.PersistentVolume) (*v1.PersistentVolume, error)
func SanitizeName ¶
SanitizeName changes any name to a sanitized name which can be accepted by kubernetes.
Types ¶
type DelayRetryError ¶ added in v1.12.0
type DelayRetryError struct {
// contains filtered or unexported fields
}
func NewDelayRetryError ¶ added in v1.12.0
func NewDelayRetryError(msg string, tryAfter time.Duration) *DelayRetryError
func (*DelayRetryError) Error ¶ added in v1.12.0
func (e *DelayRetryError) Error() string
func (*DelayRetryError) TryAfter ¶ added in v1.12.0
func (e *DelayRetryError) TryAfter() time.Duration
type SlowSet ¶ added in v1.12.0
SlowSet is a set of API objects that should be synced at slower rate. Key is typically the object namespace + name and value is timestamp when the object was added to the set.