gidallocator

package
v2.4.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// VolumeGidAnnotationKey is the key of the annotation on the PersistentVolume
	// object that specifies a supplemental GID.
	VolumeGidAnnotationKey = "pv.beta.kubernetes.io/gid"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Allocator

type Allocator struct {
	// contains filtered or unexported fields
}

Allocator allocates GIDs to PVs. It allocates from per-SC ranges and ensures that no two PVs of the same SC get the same GID.

func New

func New(client kubernetes.Interface) Allocator

New creates a new GID Allocator

func (*Allocator) AllocateNext

func (a *Allocator) AllocateNext(options controller.VolumeOptions) (int, error)

AllocateNext allocates the next available GID for the given VolumeOptions (claim's options for a volume it wants) from the appropriate GID table.

func (*Allocator) Release

func (a *Allocator) Release(volume *v1.PersistentVolume) error

Release releases the given volume's allocated GID from the appropriate GID table.

Jump to

Keyboard shortcuts

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