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 NewLeaderLock(kubeClient kubernetes.Interface, eventRecorder record.EventRecorder, ...) (resourcelock.Interface, error)
- func PVCKey(pvc *v1.PersistentVolumeClaim) string
- func PatchPVCStatus(oldPVC *v1.PersistentVolumeClaim, newPVC *v1.PersistentVolumeClaim, ...) (*v1.PersistentVolumeClaim, error)
- func RunAsLeader(lock resourcelock.Interface, config *LeaderElectionConfig, ...)
- func SanitizeName(name string) string
- func UpdatePVCapacity(pv *v1.PersistentVolume, newCapacity resource.Quantity, ...) error
- type LeaderElectionConfig
Constants ¶
const ( VolumeResizing = "Resizing" VolumeResizeFailed = "VolumeResizeFailed" VolumeResizeSuccess = "VolumeResizeSuccessful" FileSystemResizeRequired = "FileSystemResizeRequired" )
These constants are PVC condition types related to resize operation.
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 NewLeaderLock ¶
func NewLeaderLock( kubeClient kubernetes.Interface, eventRecorder record.EventRecorder, config *LeaderElectionConfig) (resourcelock.Interface, error)
NewLeaderLock creates a ResourceLock, which can be used to create leaderElector.
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 RunAsLeader ¶
func RunAsLeader(lock resourcelock.Interface, config *LeaderElectionConfig, startFunc func(context.Context))
RunAsLeader creates an leaderElector and starts the main function only after becoming a leader.
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.