package
1.33.0-alpha.2
Repository: https://github.com/kubernetes/kubernetes.git
Documentation: pkg.go.dev
# Packages
Package nestedpendingoperations is a modified implementation of
pkg/util/goroutinemap.
Package operationexecutor implements interfaces that enable execution of attach, detach, mount, and unmount operations with a nestedpendingoperations so that more than one operation is never triggered on the same volume for the same pod.
Package types defines types used only by volume components.
# Functions
AddAnnPreResizeCapacity adds volume.alpha.kubernetes.io/pre-resize-capacity from the pv.
AddSELinuxMountOption adds -o context="XYZ" mount option to a given list.
CalculateTimeoutForVolume calculates time for a Recycler pod to complete a recycle operation.
CheckPersistentVolumeClaimModeBlock checks VolumeMode.
CheckVolumeModeFilesystem checks VolumeMode.
ContainsAccessMode returns whether the requested mode is contained by modes.
ContainsAllAccessModes returns whether all of the requested modes are contained by modes.
DeleteAnnPreResizeCapacity deletes volume.alpha.kubernetes.io/pre-resize-capacity from the pv.
FSGroupCompleteHook returns a hook to call when volume recursive permission is changed.
FsUserFrom returns FsUser of pod, which is determined by the runAsUser attributes.
GenericResizeFS : call generic filesystem resizer for plugins that don't have any special filesystem resize requirements.
GetCSIAttachLimitKey returns limit key used for CSI volumes.
GetDefaultClass returns the default StorageClass from the store, or nil.
GetFullQualifiedPluginNameForVolume returns full qualified plugin name for given volume.
GetMountSELinuxLabel returns SELinux labels that should be used to mount the given volume volumeSpec and podSecurityContext.
GetPath checks if the path from the mounter is empty.
GetPersistentVolumeClaimQualifiedName returns a qualified name for pvc.
GetPodVolumeNames returns names of volumes that are used in a pod, either as filesystem mount or raw block device.
GetReliableMountRefs calls mounter.GetMountRefs and retries on IsInconsistentReadError.
GetSecretForPV locates secret by name and namespace, verifies the secret type, and returns secret map.
GetUniquePodName returns a unique identifier to reference a pod by.
GetUniqueVolumeName returns a unique name representing the volume/plugin.
GetUniqueVolumeNameFromSpec uses the given VolumePlugin to generate a unique name representing the volume defined in the specified volume spec.
GetUniqueVolumeNameFromSpecWithPod returns a unique volume name with pod name included.
GetVolumeMode retrieves VolumeMode from pv.
GetWindowsPath get a windows path.
HasMountRefs checks if the given mountPath has mountRefs.
IsAttachableVolume checks if the given volumeSpec is an attachable volume or not.
IsDefaultAnnotation returns a boolean if the default storage class annotation is set TODO: remove Beta when no longer needed.
IsDeviceMountableVolume checks if the given volumeSpec is an device mountable volume or not.
IsLocalEphemeralVolume determines whether the argument is a local ephemeral volume vs.
IsMultiAttachAllowed checks if attaching this volume to multiple nodes is definitely not allowed/possible.
IsPodTerminated checks if pod is terminated.
IsReady checks for the existence of a regular file called 'ready' in the given directory and returns true if that file exists.
IsWindowsLocalPath checks if path is a local path prefixed with "/" or "\" like "/foo/bar" or "\foo\bar".
IsWindowsUNCPath checks if path is prefixed with \\ This can be used to skip any processing of paths that point to SMB shares, local named pipes and local UNC path.
JoinMountOptions joins mount options eliminating duplicates.
LoadPodFromFile will read, decode, and return a Pod from a file.
MakeAbsolutePath convert path to absolute path according to GOOS.
MakeNestedMountpoints creates mount points in baseDir for volumes mounted beneath name.
MapBlockVolume is a utility function to provide a common way of mapping block device path for a specified volume and pod.
MarkForFSResize marks file system resizing as pending.
MarkFSResizeFinished marks file system resizing as done.
MarkNodeExpansionInfeasible marks a PVC for node expansion as failed.
MarkNodeExpansionInProgress marks pvc expansion in progress on node.
MarkResizeFinished marks all resizing as done.
MarkResizeInProgressWithResizer marks cloudprovider resizing as in progress and also annotates the PVC with the name of the resizer.
MergeResizeConditionOnPVC updates pvc with requested resize conditions leaving other conditions untouched.
MountOptionFromSpec extracts and joins mount options from volume spec with supplied options.
NewAtomicWriter creates a new AtomicWriter configured to write to the given target directory, or returns an error if the target directory does not exist.
NewDeviceHandler Create a new IoHandler implementation.
NewFakeSELinuxLabelTranslator returns a fake translator for unit tests.
NewIOHandler Create a new IoHandler implementation.
NewSafeFormatAndMountFromHost creates a new SafeFormatAndMount with Mounter and Exec taken from given VolumeHost.
NewSELinuxLabelTranslator returns new SELinuxLabelTranslator for the platform.
OperationCompleteHook returns a hook to call when an operation is completed.
PatchPV creates and executes a patch for pv.
PatchPVCStatus updates PVC status using PATCH verb Don't use Update because this can be called from kubelet and if kubelet has an older client its Updates will overwrite new fields.
RecordCSIOperationLatencyMetrics records the CSI operation latency and grpc status into metric csi_kubelet_operations_seconds.
RecordOperationLatencyMetric records the end to end latency for certain operation into metric volume_operation_total_seconds.
SetClaimResizer sets resizer annotation on PVC.
SetReady creates a file called 'ready' in the given directory.
SplitUniqueName splits the unique name to plugin name and volume name strings.
SupportsSELinuxContextMount checks if the given volumeSpec supports with mount -o context.
UnmapBlockVolume is a utility function to provide a common way of unmapping block device path for a specified volume and pod.
UnmountViaEmptyDir delegates the tear down operation for secret, configmap, git_repo and downwardapi to empty_dir.
UpdatePVSize updates just pv size after cloudprovider resizing is successful.
VolumeSupportsSELinuxMount returns true if given volume access mode can support mount with SELinux mount options.
# Constants
AzureVolumeLimitKey stores resource name that will store volume limits for Azure.
betaIsDefaultStorageClassAnnotation is the beta version of IsDefaultStorageClassAnnotation.
CinderVolumeLimitKey contains Volume limit key for Cinder.
ControllerManagedAttachAnnotation is the key of the annotation on Node objects that indicates attach/detach operations for the node should be managed by the attach/detach controller.
CSIAttachLimitPrefix defines prefix used for CSI volumes.
DefaultMaxCinderVolumes defines the maximum number of PD Volumes for Cinder For Openstack we are keeping this to a high enough value so as depending on backend cluster admins can configure it.
DefaultMaxEBSNitroVolumeLimit is default EBS volume limit on m5 and c5 instances.
DefaultMaxEBSVolumes is the limit for volumes attached to an instance.
EBSNitroLimitRegex finds nitro instance types with different limit than EBS defaults.
EBSVolumeLimitKey resource name that will store volume limits for EBS.
GCEVolumeLimitKey stores resource name that will store volume limits for GCE node.
isDefaultStorageClassAnnotation represents a StorageClass annotation that marks a class as the default StorageClass.
MountsInGlobalPDPath is name of the directory appended to a volume plugin name to create the place for volume mounts in the global PD path.
PVCProtectionFinalizer is the name of finalizer on PVCs that have a running pod.
PVProtectionFinalizer is the name of finalizer on PVs that are bound by PVCs.
ResourceNameLengthLimit stores maximum allowed Length for a ResourceName.
VACProtectionFinalizer is the name of finalizer on VACs that are used by PVs or PVCs.
VolumeDynamicallyCreatedByKey is the key of the annotation on PersistentVolume object created dynamically.
VolumeGidAnnotationKey is the of the annotation on the PersistentVolume object that specifies a supplemental GID.
# Variables
AnnPreResizeCapacity annotation is added to a PV when expanding volume.
# Structs
AtomicWriter handles atomically projecting content for a set of files into a target directory.
FileProjection contains file Data and access Mode.
MultipleSELinuxLabelsError tells that one volume in a pod is mounted in multiple containers and each has a different SELinux label.
SELinuxLabelInfo contains information about SELinux labels that should be used to mount a volume for a Pod.
# Interfaces
DeviceUtil is a util for common device methods.
IoUtil is a mockable util for common IO operations.
SELinuxLabelTranslator translates v1.SELinuxOptions of a process to SELinux file label.