metadata

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2026 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

View Source
const SATokenVolumeContextKey = "csi.storage.k8s.io/serviceAccount.tokens"

SATokenVolumeContextKey is the VolumeContext key under which kubelet injects the mounting pod's bound ServiceAccount bearer token when the CSIDriver declares spec.tokenRequests. The value is sensitive and must never appear in log output.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	// VolumeID as set in Node{Un,}PublishVolumeRequests.
	VolumeID string `json:"volumeID"`

	// TargetPath is the path bind mounted into the target container (e.g. in
	// Kubernetes, this is within the kubelet's 'pods' directory).
	TargetPath string `json:"targetPath"`

	// NextIssuanceTime is the time after which a re-issuance should begin.
	NextIssuanceTime *time.Time `json:"nextIssuanceTime,omitempty"`

	// System-specific attributes extracted from the NodePublishVolume request.
	// These are sourced from the VolumeContext.
	VolumeContext map[string]string `json:"volumeContext,omitempty"`

	// VolumeMountGroup is the filesystem group that the volume should be mounted as.
	VolumeMountGroup string `json:"volumeMountGroup,omitempty"`
}

Metadata contains metadata about a particular CSI volume and its contents. It is safe to be serialised to disk for later reading (e.g. upon renewals).

func FromNodePublishVolumeRequest

func FromNodePublishVolumeRequest(request *csi.NodePublishVolumeRequest) Metadata

FromNodePublishVolumeRequest constructs a Metadata from a NodePublishVolumeRequest. The NextIssuanceTime field will NOT be set.

func (Metadata) MarshalLog added in v0.11.0

func (m Metadata) MarshalLog() any

MarshalLog implements logr.Marshaler so that structured loggers redact the SA bearer token from VolumeContext before emitting a log entry. Without this, log.Info("...", "metadata", meta) would print the live ServiceAccount token injected by kubelet.

Jump to

Keyboard shortcuts

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