util

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CSI Plugin Name
	CSIPluginName                = "kubernetes.io/csi"
	DefaultKubeletPluginsDirName = "plugins"

	DefaultKubeletPodsDirName         = "pods"
	DefaultKubeletVolumesDirName      = "volumes"
	DefaultKubeletBlockVolumesDirName = "volumeDevices"
	DefaultEventIndexerName           = "event-uid"
	DefaultRecoveryEventMessage       = "The Volume returns to the healthy state"
)

Variables

View Source
var (
	EnvNodeName = "NODE_NAME"
)

Functions

func EscapeQualifiedName

func EscapeQualifiedName(in string) string

EscapeQualifiedName replace "/" with "~"

func GetVolumePath

func GetVolumePath(kubeletRootDir, pvName, podUID string, isBlock bool) string

GetVolumePath generates volume path

func MakeDeviceMountPath

func MakeDeviceMountPath(kubeletRootDir string, pv *v1.PersistentVolume) (string, error)

MakeDeviceMountPath generates device mount path

Types

type PVCToPodsCache

type PVCToPodsCache struct {
	sync.Mutex
	// contains filtered or unexported fields
}

PVCToPodsCache stores PVCs/Pods mapping info we can get all pods using one specific PVC more efficiently by this

func NewPVCToPodsCache

func NewPVCToPodsCache() *PVCToPodsCache

NewPVCToPodsCache creates a new PVCToPodsCache

func (*PVCToPodsCache) AddPod

func (cache *PVCToPodsCache) AddPod(pod *v1.Pod)

TODO: support inline csi volumes

func (*PVCToPodsCache) DeletePod

func (cache *PVCToPodsCache) DeletePod(pod *v1.Pod)

TODO: support inline csi volumes

func (*PVCToPodsCache) GetPodsByPVC

func (cache *PVCToPodsCache) GetPodsByPVC(pvcNamespace, pvcName string) PodSet

type PodSet

type PodSet map[string]*v1.Pod

PodSet is a pod map, whose key is podname + "/" + podname

Jump to

Keyboard shortcuts

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