util

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

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

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

func SanitizeName(name string) string

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.

Jump to

Keyboard shortcuts

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