util

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2021 License: Apache-2.0 Imports: 7 Imported by: 7

Documentation

Index

Constants

View Source
const (
	VolumeResizing           = "Resizing"
	VolumeResizeFailed       = "VolumeResizeFailed"
	VolumeResizeSuccess      = "VolumeResizeSuccessful"
	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 GetPVCPatchData added in v1.0.0

func GetPVCPatchData(oldPVC, newPVC *v1.PersistentVolumeClaim) ([]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 MergeResizeConditionsOfPVC

func MergeResizeConditionsOfPVC(oldConditions, newConditions []v1.PersistentVolumeClaimCondition) []v1.PersistentVolumeClaimCondition

MergeResizeConditionsOfPVC updates pvc with requested resize conditions leaving other conditions untouched.

func PVCKey

func PVCKey(pvc *v1.PersistentVolumeClaim) string

PVCKey returns an unique key of a PVC object,

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