Documentation
¶
Overview ¶
pkg/resources/pvs/pv.go
pkg/resources/pvs/types.go
Index ¶
- func Create(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, ...) error
- func Delete(ctx context.Context, kube kubeclient.KubeClient, name string) error
- func DeleteIfOwned(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, ...) error
- func Update(ctx context.Context, kube kubeclient.KubeClient, owner domain.Object, ...) error
- type ResolvedPVSpec
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.
Click to show internal directories.
Click to hide internal directories.