volume

package
v0.61.1 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultVolumeDetachTimeout = 1 * time.Minute
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DetachmentError

type DetachmentError struct {
	RemainingVAs []string
}

func (*DetachmentError) Error

func (e *DetachmentError) Error() string

type DetachmentWaitOptions

type DetachmentWaitOptions struct {
	NodeName string
	// Timeout is the maximum time to wait for volumes to detach.
	// If zero, the waiter's default timeout is used.
	Timeout time.Duration

	// PodsToExclude are pods whose VolumeAttachments should not be waited for
	// (e.g., DaemonSet pods, static pods that won't be evicted).
	PodsToExclude []v1.Pod
}

type DetachmentWaiter

type DetachmentWaiter interface {
	// Wait waits for all VolumeAttachments on the specified node to be deleted.
	// VolumeAttachments belonging to opts.PodsToExclude are not waited for.
	// If opts.Timeout is zero, the waiter's default timeout is used.
	// Returns nil on success.
	// Returns error on timeout, unexpected failures or context cancellation.
	Wait(ctx context.Context, log logrus.FieldLogger, opts DetachmentWaitOptions) error
}

DetachmentWaiter waits for VolumeAttachments to be detached from a node.

func NewDetachmentWaiter

func NewDetachmentWaiter(
	clientset kubernetes.Interface,
	vaIndexer cache.Indexer,
	pollInterval time.Duration,
	defaultTimeout time.Duration,
) DetachmentWaiter

NewDetachmentWaiter creates a new DetachmentWaiter. Returns nil if vaIndexer is nil. defaultTimeout is the timeout to use when DetachmentWaitOptions.Timeout is zero. If defaultTimeout is zero, DefaultVolumeDetachTimeout is used.

Jump to

Keyboard shortcuts

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