pvs

package
v0.7.9 Latest Latest
Warning

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

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

Documentation

Overview

pkg/resources/pvs/pv.go

pkg/resources/pvs/types.go

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedPVSpec) error

Create creates a PersistentVolume if it does not already exist. PVs are cluster-scoped — owner references are set as labels only.

func Delete

func Delete(ctx context.Context, kube kubeclient.KubeClient, name string) error

Delete deletes the PV if it exists.

func DeleteIfOwned

func DeleteIfOwned(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, name string) error

DeleteIfOwned deletes the PV only if the owner label matches.

func Update

func Update(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, spec ResolvedPVSpec) error

Update reconciles an existing PV. Capacity and reclaim policy are patched on drift.

Types

type ResolvedPVSpec

type ResolvedPVSpec struct {
	Name             string
	StorageClassName string
	Capacity         string
	AccessModes      []string
	ReclaimPolicy    string
	HostPath         string
	CSIDriver        string
	CSIVolumeHandle  string
	Labels           map[string]string

	// Sleep injects an artificial delay into the reconcile of this resource.
	// Useful for autoscale testing, latency simulation, and chaos engineering.
	// Accepts extended duration units (s, m, h, d, w, mo, y).
	Sleep string
}

ResolvedPVSpec is the fully resolved PersistentVolume specification. PersistentVolumes are cluster-scoped — Namespace is not used.

func Resolve

func Resolve(src orktypes.PVTemplateSource, ownerName string) ResolvedPVSpec

Resolve builds a ResolvedPVSpec from a PVTemplateSource.

Jump to

Keyboard shortcuts

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