Documentation
¶
Index ¶
- Constants
- func HasFileSystemResizePendingCondition(pvc *v1.PersistentVolumeClaim) bool
- func MergeResizeConditionsOfPVC(oldConditions, newConditions []v1.PersistentVolumeClaimCondition) []v1.PersistentVolumeClaimCondition
- func NewK8sClient(master, kubeConfig string) (kubernetes.Interface, error)
- func PVCKey(pvc *v1.PersistentVolumeClaim) string
- func PatchPVCStatus(oldPVC *v1.PersistentVolumeClaim, newPVC *v1.PersistentVolumeClaim, ...) (*v1.PersistentVolumeClaim, error)
- func SanitizeName(name string) string
- func UpdatePVCapacity(pv *v1.PersistentVolume, newCapacity resource.Quantity, ...) error
Constants ¶
const ( VolumeResizing = "Resizing" VolumeResizeFailed = "VolumeResizeFailed" VolumeResizeSuccess = "VolumeResizeSuccessful" 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 ¶
This section is empty.
Functions ¶
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 kublete side operation is in progress.
func MergeResizeConditionsOfPVC ¶
func MergeResizeConditionsOfPVC(oldConditions, newConditions []v1.PersistentVolumeClaimCondition) []v1.PersistentVolumeClaimCondition
MergeResizeConditionsOfPVC updates pvc with requested resize conditions leaving other conditions untouched.
func NewK8sClient ¶
func NewK8sClient(master, kubeConfig string) (kubernetes.Interface, error)
NewK8sClient is an utility function used to create a kubernetes sdk client.
func PVCKey ¶
func PVCKey(pvc *v1.PersistentVolumeClaim) string
PVCKey returns an unique key of a PVC object,
func PatchPVCStatus ¶
func PatchPVCStatus( oldPVC *v1.PersistentVolumeClaim, newPVC *v1.PersistentVolumeClaim, kubeClient kubernetes.Interface) (*v1.PersistentVolumeClaim, error)
PatchPVCStatus updates PVC status using PATCH verb
func SanitizeName ¶
SanitizeName changes any name to a sanitized name which can be accepted by kubernetes.
func UpdatePVCapacity ¶
func UpdatePVCapacity(pv *v1.PersistentVolume, newCapacity resource.Quantity, kubeClient kubernetes.Interface) error
UpdatePVCapacity updates PVC capacity with requested size.
Types ¶
This section is empty.