util

package
v1.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2024 License: Apache-2.0 Imports: 15 Imported by: 6

Documentation

Index

Constants

View Source
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.

View Source
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

View Source
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 GetObjectKey(obj interface{}) (string, error)

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 GetPatchData(oldObj, newObj interface{}) ([]byte, error)

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 IsFinalError added in v1.10.0

func IsFinalError(err error) bool

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) []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

func SanitizeName(name string) string

SanitizeName changes any name to a sanitized name which can be accepted by kubernetes.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL