controller

package
v0.0.230 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2025 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SharedVolumePodFinalizer         = "sharedvolume.sv/pod-cleanup"
	SharedVolumeAnnotationKey        = "sharedvolume.sv"
	ClusterSharedVolumeAnnotationKey = "sharedvolume.csv"
)
View Source
const (
	// ClusterSharedVolumeOperationNamespace is the namespace used for ClusterSharedVolume operations
	ClusterSharedVolumeOperationNamespace = "shared-volume-controller"
)
View Source
const (
	// NfsServerGeneratingAnnotation marks when NfsServer generation is in progress
	NfsServerGeneratingAnnotation = "shared-volume.io/nfsserver-generating"
)
View Source
const (
	SyncControllerName = "sync-controller"
)

Variables

This section is empty.

Functions

func ContainsString

func ContainsString(slice []string, s string) bool

ContainsString checks if a slice contains a specific string

func RemoveString

func RemoveString(slice []string, s string) []string

RemoveString removes a specific string from a slice

Types

type ClusterSharedVolumeReconciler

type ClusterSharedVolumeReconciler struct {
	*VolumeControllerBase
}

ClusterSharedVolumeReconciler reconciles a ClusterSharedVolume object

func (*ClusterSharedVolumeReconciler) Reconcile

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.21.0/pkg/reconcile

func (*ClusterSharedVolumeReconciler) SetupWithManager

func (r *ClusterSharedVolumeReconciler) SetupWithManager(mgr ctrl.Manager, controllerNamespace string) error

SetupWithManager sets up the controller with the Manager.

type ControllerSetupConfig

type ControllerSetupConfig struct {
	VolumeType          client.Object
	ControllerName      string
	ControllerNamespace string
	PreSetupHook        func(ctrl.Manager, *VolumeControllerBase) error
	Runnables           []manager.Runnable // Use controller-runtime manager.Runnable interface
}

ControllerSetupConfig holds configuration for generic controller setup

type OneTimeRecoveryRunnable

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

OneTimeRecoveryRunnable is a generic runnable that executes a recovery operation once

func NewOneTimeRecoveryRunnable

func NewOneTimeRecoveryRunnable(name string, recoveryFunc func(context.Context) error, needsLeader bool) *OneTimeRecoveryRunnable

NewOneTimeRecoveryRunnable creates a new one-time recovery runnable

func (*OneTimeRecoveryRunnable) NeedLeaderElection

func (r *OneTimeRecoveryRunnable) NeedLeaderElection() bool

NeedLeaderElection returns whether this runnable needs leader election

func (*OneTimeRecoveryRunnable) Start

Start implements the Runnable interface

type PodCleanupReconciler

type PodCleanupReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

PodCleanupReconciler reconciles Pod deletions for SharedVolume cleanup

func (*PodCleanupReconciler) Reconcile

func (r *PodCleanupReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile handles pod deletion cleanup

func (*PodCleanupReconciler) SetupWithManager

func (r *PodCleanupReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager

type SharedVolumeReconciler

type SharedVolumeReconciler struct {
	*VolumeControllerBase
}

SharedVolumeReconciler reconciles a SharedVolume object

func (*SharedVolumeReconciler) Reconcile

func (r *SharedVolumeReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.21.0/pkg/reconcile

func (*SharedVolumeReconciler) SetupWithManager

func (r *SharedVolumeReconciler) SetupWithManager(mgr ctrl.Manager, controllerNamespace string) error

SetupWithManager sets up the controller with the Manager.

type SharedVolumeRef

type SharedVolumeRef struct {
	Namespace string
	Name      string
}

SharedVolumeRef represents a reference to a SharedVolume (legacy, for backward compatibility)

type SyncController

type SyncController struct {
	client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

SyncController manages sync operations for SharedVolumes

func NewSyncController

func NewSyncController(client client.Client, scheme *runtime.Scheme) *SyncController

NewSyncController creates a new SyncController

func (*SyncController) RecoverSyncOperations

func (s *SyncController) RecoverSyncOperations(ctx context.Context) error

RecoverSyncOperations starts sync operations for all existing ready SharedVolumes and ClusterSharedVolumes This should be called when the controller starts to resume sync operations after pod restart

func (*SyncController) StartSyncForClusterSharedVolume

func (s *SyncController) StartSyncForClusterSharedVolume(ctx context.Context, csv *svv1alpha1.ClusterSharedVolume) error

StartSyncForClusterSharedVolume starts sync operations for a ClusterSharedVolume

func (*SyncController) StartSyncForSharedVolume

func (s *SyncController) StartSyncForSharedVolume(ctx context.Context, sv *svv1alpha1.SharedVolume) error

StartSyncForSharedVolume starts sync operations for a SharedVolume

func (*SyncController) StopSyncForClusterSharedVolume

func (s *SyncController) StopSyncForClusterSharedVolume(csv *svv1alpha1.ClusterSharedVolume)

StopSyncForClusterSharedVolume stops sync operations for a ClusterSharedVolume

func (*SyncController) StopSyncForSharedVolume

func (s *SyncController) StopSyncForSharedVolume(sv *svv1alpha1.SharedVolume)

StopSyncForSharedVolume stops sync operations for a SharedVolume

type SyncRequest

type SyncRequest struct {
	Source  SyncSource `json:"source"`
	Target  SyncTarget `json:"target"`
	Timeout string     `json:"timeout"`
}

SyncRequest represents the payload for sync API calls

type SyncSource

type SyncSource struct {
	Type    string      `json:"type"`
	Details interface{} `json:"details"`
}

type SyncSourceGit

type SyncSourceGit struct {
	URL        string `json:"url"`
	User       string `json:"user,omitempty"`
	Password   string `json:"password,omitempty"`
	PrivateKey string `json:"privateKey,omitempty"`
	Branch     string `json:"branch,omitempty"`
}

type SyncSourceHTTP

type SyncSourceHTTP struct {
	URL string `json:"url"`
}

type SyncSourceS3

type SyncSourceS3 struct {
	EndpointURL string `json:"endpointUrl"`
	BucketName  string `json:"bucketName"`
	Path        string `json:"path,omitempty"`
	AccessKey   string `json:"accessKey"`
	SecretKey   string `json:"secretKey"`
	Region      string `json:"region"`
}

type SyncSourceSSH

type SyncSourceSSH struct {
	Host       string `json:"host"`
	Port       int    `json:"port"`
	User       string `json:"user"`
	Path       string `json:"path"`
	Password   string `json:"password,omitempty"`
	PrivateKey string `json:"privateKey,omitempty"`
}

type SyncTarget

type SyncTarget struct {
	Path string `json:"path"`
}

type VolumeControllerBase

type VolumeControllerBase struct {
	client.Client
	Scheme *runtime.Scheme
	// ControllerNamespace is the namespace where controller resources will be created
	ControllerNamespace string
	// SyncController handles sync operations
	SyncController *SyncController
}

VolumeControllerBase contains the shared implementation for volume controllers

func NewVolumeControllerBase

func NewVolumeControllerBase(client client.Client, scheme *runtime.Scheme, controllerNamespace string, syncController *SyncController) *VolumeControllerBase

NewVolumeControllerBase creates a new VolumeControllerBase instance

func (*VolumeControllerBase) CheckAndUpdateNfsServerStatus

func (r *VolumeControllerBase) CheckAndUpdateNfsServerStatus(ctx context.Context, volumeObj VolumeObject, namespace string) (ctrl.Result, error)

CheckAndUpdateNfsServerStatus checks NfsServer status and updates volume status accordingly

func (*VolumeControllerBase) CheckNfsServerStatus

func (r *VolumeControllerBase) CheckNfsServerStatus(ctx context.Context, volumeObj VolumeObject, namespace string) (bool, string, string, error)

CheckNfsServerStatus checks if the NfsServer exists and is ready

func (*VolumeControllerBase) CheckResourceReadiness

func (r *VolumeControllerBase) CheckResourceReadiness(ctx context.Context, volumeObj VolumeObject, namespace string,
	onReady func(ctx context.Context, volumeObj VolumeObject) error,
	onNotReady func(ctx context.Context, volumeObj VolumeObject) error) error

CheckResourceReadiness checks the readiness of all resources associated with a volume

func (*VolumeControllerBase) CleanupAllPVCs

func (b *VolumeControllerBase) CleanupAllPVCs(ctx context.Context, volume VolumeObject, referenceValue string)

CleanupAllPVCs deletes all PVCs related to this volume

func (*VolumeControllerBase) CleanupAllPVCsInNamespace

func (b *VolumeControllerBase) CleanupAllPVCsInNamespace(ctx context.Context, volume VolumeObject, referenceValue string, operationalNamespace string)

CleanupAllPVCsInNamespace deletes all PVCs related to this volume in the specified namespace

func (*VolumeControllerBase) CleanupAllPVs

func (b *VolumeControllerBase) CleanupAllPVs(ctx context.Context, volume VolumeObject, referenceValue string)

CleanupAllPVs deletes all PVs related to this volume

func (*VolumeControllerBase) CleanupAllPVsWithWait

func (b *VolumeControllerBase) CleanupAllPVsWithWait(ctx context.Context, volume VolumeObject, referenceValue string)

CleanupAllPVsWithWait deletes all PVs related to this volume and waits for them to be completely gone

func (*VolumeControllerBase) CleanupAllPodsUsingVolume

func (b *VolumeControllerBase) CleanupAllPodsUsingVolume(ctx context.Context, volume VolumeObject)

CleanupAllPodsUsingVolume finds and force deletes all pods that use this volume

func (*VolumeControllerBase) CleanupAllPodsUsingVolumeInNamespace

func (b *VolumeControllerBase) CleanupAllPodsUsingVolumeInNamespace(ctx context.Context, volume VolumeObject, operationalNamespace string)

CleanupAllPodsUsingVolumeInNamespace finds and force deletes all pods that use this volume in the specified namespace

func (*VolumeControllerBase) CleanupNFSServer

func (b *VolumeControllerBase) CleanupNFSServer(ctx context.Context, volume VolumeObject)

CleanupNFSServer deletes the NFS server if it was generated

func (*VolumeControllerBase) CleanupNFSServerInNamespace

func (b *VolumeControllerBase) CleanupNFSServerInNamespace(ctx context.Context, volume VolumeObject, operationalNamespace string)

CleanupNFSServerInNamespace deletes the NFS server if it was generated in the specified namespace

func (*VolumeControllerBase) CleanupReplicaSet

func (b *VolumeControllerBase) CleanupReplicaSet(ctx context.Context, volume VolumeObject, referenceValue string)

CleanupReplicaSet deletes the ReplicaSet and any remaining pods

func (*VolumeControllerBase) CleanupReplicaSetInNamespace

func (b *VolumeControllerBase) CleanupReplicaSetInNamespace(ctx context.Context, volume VolumeObject, referenceValue string, operationalNamespace string)

CleanupReplicaSetInNamespace deletes the ReplicaSet and any remaining pods in the specified namespace

func (*VolumeControllerBase) CleanupResources

func (b *VolumeControllerBase) CleanupResources(ctx context.Context, volume VolumeObject) error

CleanupResources removes all resources associated with a volume

func (*VolumeControllerBase) CleanupResourcesInNamespace

func (b *VolumeControllerBase) CleanupResourcesInNamespace(ctx context.Context, volume VolumeObject, operationalNamespace string) error

CleanupResourcesInNamespace removes all resources associated with a volume in the specified namespace

func (*VolumeControllerBase) CleanupService

func (b *VolumeControllerBase) CleanupService(ctx context.Context, volume VolumeObject, referenceValue string)

CleanupService deletes the service

func (*VolumeControllerBase) CleanupServiceInNamespace

func (b *VolumeControllerBase) CleanupServiceInNamespace(ctx context.Context, volume VolumeObject, referenceValue string, operationalNamespace string)

CleanupServiceInNamespace deletes the service in the specified namespace

func (*VolumeControllerBase) CreateAndOwnNfsServer

func (r *VolumeControllerBase) CreateAndOwnNfsServer(ctx context.Context, volumeObj VolumeObject, namespace string) error

CreateAndOwnNfsServer creates an NfsServer resource and sets ownership

func (*VolumeControllerBase) CreateNoOpNotReadyCallback

func (r *VolumeControllerBase) CreateNoOpNotReadyCallback() func(context.Context, VolumeObject) error

CreateNoOpNotReadyCallback creates a callback that does nothing when volume is not ready

func (*VolumeControllerBase) CreateNoOpReadyCallback

func (r *VolumeControllerBase) CreateNoOpReadyCallback() func(context.Context, VolumeObject) error

CreateNoOpReadyCallback creates a callback that does nothing when volume is ready

func (*VolumeControllerBase) CreateSyncControllerSetupHook

func (r *VolumeControllerBase) CreateSyncControllerSetupHook(createSyncController func(client.Client, *runtime.Scheme) *SyncController, recoveryFunc func(context.Context) error) func(ctrl.Manager, *VolumeControllerBase) error

CreateSyncControllerSetupHook creates a pre-setup hook for controllers that need sync operations

func (*VolumeControllerBase) CreateSyncNotReadyCallback

func (r *VolumeControllerBase) CreateSyncNotReadyCallback() func(context.Context, VolumeObject) error

CreateSyncNotReadyCallback creates a generic callback for when volume is not ready that handles sync operations

func (*VolumeControllerBase) CreateSyncReadyCallback

func (r *VolumeControllerBase) CreateSyncReadyCallback() func(context.Context, VolumeObject) error

CreateSyncReadyCallback creates a generic callback for when volume is ready that handles sync operations

func (*VolumeControllerBase) DeterminePhase

func (r *VolumeControllerBase) DeterminePhase(nfsReady, replicaSetReady bool) string

DeterminePhase determines the correct phase based on NFS and ReplicaSet readiness

func (*VolumeControllerBase) EnsureAPIVersionAndKind

func (r *VolumeControllerBase) EnsureAPIVersionAndKind(obj client.Object, apiVersion, kind string)

EnsureAPIVersionAndKind ensures that APIVersion and Kind are set for owner references

func (*VolumeControllerBase) EnsureControllerNamespace

func (r *VolumeControllerBase) EnsureControllerNamespace(ctx context.Context) error

EnsureControllerNamespace ensures that the controller namespace exists

func (*VolumeControllerBase) FillAndValidateSpec

func (r *VolumeControllerBase) FillAndValidateSpec(volumeObj VolumeObject, generateNfsServer bool, namespace string) error

FillAndValidateSpec fills defaults and validates the volume spec.

func (*VolumeControllerBase) ForceCleanupAllResources

func (b *VolumeControllerBase) ForceCleanupAllResources(ctx context.Context, volume VolumeObject, referenceValue string)

ForceCleanupAllResources immediately force deletes all remaining pods without waiting

func (*VolumeControllerBase) ForceCleanupAllResourcesInNamespace

func (b *VolumeControllerBase) ForceCleanupAllResourcesInNamespace(ctx context.Context, volume VolumeObject, referenceValue string, operationalNamespace string)

ForceCleanupAllResourcesInNamespace immediately force deletes all remaining pods without waiting in the specified namespace

func (*VolumeControllerBase) ForceDeletePV

func (b *VolumeControllerBase) ForceDeletePV(ctx context.Context, pv *corev1.PersistentVolume) error

ForceDeletePV attempts to delete a PV and removes finalizers if deletion is stuck

func (*VolumeControllerBase) ForceDeletePVC

ForceDeletePVC attempts to delete a PVC and removes finalizers if deletion is stuck

func (*VolumeControllerBase) ForceDeletePod

func (b *VolumeControllerBase) ForceDeletePod(ctx context.Context, pod *corev1.Pod) error

ForceDeletePod attempts to delete a pod and removes all finalizers if deletion is stuck

func (*VolumeControllerBase) GenerateAndCreateNfsServer

func (r *VolumeControllerBase) GenerateAndCreateNfsServer(ctx context.Context, volumeObj VolumeObject, resourcePrefix string, namespace string) (ctrl.Result, error)

GenerateAndCreateNfsServer creates an NFS server for the VolumeObject with default configuration

func (*VolumeControllerBase) GetManagedNfsServerAddress

func (r *VolumeControllerBase) GetManagedNfsServerAddress(volumeObj VolumeObject, nfsServerSpec *svv1alpha1.NfsServerSpec) string

GetManagedNfsServerAddress retrieves the address from a managed NfsServer resource

func (*VolumeControllerBase) HandleFinalizerLogic

func (r *VolumeControllerBase) HandleFinalizerLogic(ctx context.Context, obj client.Object, finalizerName string) (bool, error)

HandleFinalizerLogic handles the common finalizer pattern for volume objects. Returns true if reconciliation should continue, false if it should exit early.

func (*VolumeControllerBase) IsExternalNfsServer

func (r *VolumeControllerBase) IsExternalNfsServer(nfsServerSpec *svv1alpha1.NfsServerSpec) bool

IsExternalNfsServer determines if the NFS server spec refers to an external server rather than a managed NfsServer resource

func (*VolumeControllerBase) IsPVCReady

func (r *VolumeControllerBase) IsPVCReady(ctx context.Context, volumeObj VolumeObject, namespace string) (bool, error)

IsPVCReady checks if the PVC associated with the volume is bound

func (*VolumeControllerBase) IsReplicaSetReady

func (r *VolumeControllerBase) IsReplicaSetReady(ctx context.Context, volumeObj VolumeObject, namespace string) (bool, error)

IsReplicaSetReady checks if the ReplicaSet associated with the volume is ready

func (*VolumeControllerBase) RandString

func (r *VolumeControllerBase) RandString(n int) string

RandString generates a random alphanumeric string of given length.

func (*VolumeControllerBase) ReconcileGeneric

func (r *VolumeControllerBase) ReconcileGeneric(
	ctx context.Context,
	req ctrl.Request,
	config VolumeReconcileConfig,
) (ctrl.Result, error)

ReconcileGeneric provides a complete generic reconciliation pattern for volume objects

func (*VolumeControllerBase) ReconcileNfsServer

func (r *VolumeControllerBase) ReconcileNfsServer(ctx context.Context, volumeObj VolumeObject, generateNfsServer bool, namespace string) (ctrl.Result, error)

ReconcileNfsServer handles the NfsServer lifecycle management

func (*VolumeControllerBase) ReconcileNfsServerComplete

func (r *VolumeControllerBase) ReconcileNfsServerComplete(ctx context.Context, volumeObj VolumeObject, namespace string, generateNfsServer bool, resourcePrefix string,
	onReady func(ctx context.Context, volumeObj VolumeObject) error,
	onNotReady func(ctx context.Context, volumeObj VolumeObject) error) (ctrl.Result, error)

ReconcileNfsServerComplete handles the complete NfsServer lifecycle management including generation, resource reconciliation, and readiness checking

func (*VolumeControllerBase) ReconcilePersistentVolume

func (r *VolumeControllerBase) ReconcilePersistentVolume(ctx context.Context, volumeObj VolumeObject, namespace string) error

ReconcilePersistentVolume creates or updates the PersistentVolume

func (*VolumeControllerBase) ReconcilePersistentVolumeClaim

func (r *VolumeControllerBase) ReconcilePersistentVolumeClaim(ctx context.Context, volumeObj VolumeObject, namespace string) error

ReconcilePersistentVolumeClaim creates or updates the PersistentVolumeClaim

func (*VolumeControllerBase) ReconcileReplicaSet

func (r *VolumeControllerBase) ReconcileReplicaSet(ctx context.Context, volumeObj VolumeObject, namespace string) error

ReconcileReplicaSet creates or updates the ReplicaSet

func (*VolumeControllerBase) ReconcileRequiredResources

func (r *VolumeControllerBase) ReconcileRequiredResources(ctx context.Context, volumeObj VolumeObject, namespace string) error

ReconcileRequiredResources creates or updates the PV, PVC, ReplicaSet, and Service resources

func (*VolumeControllerBase) ReconcileService

func (r *VolumeControllerBase) ReconcileService(ctx context.Context, volumeObj VolumeObject, namespace string) error

ReconcileService creates or updates the Service

func (*VolumeControllerBase) ReconcileVolume

func (r *VolumeControllerBase) ReconcileVolume(ctx context.Context, req ctrl.Request,
	volumeObj VolumeObject, finalizerName string, namespace string,
	onReady func(context.Context, VolumeObject) error,
	onNotReady func(context.Context, VolumeObject) error) (ctrl.Result, error)

ReconcileVolume provides a generic reconciliation pattern for volume objects

func (*VolumeControllerBase) RemoveFinalizerWithRetry

func (r *VolumeControllerBase) RemoveFinalizerWithRetry(ctx context.Context, obj client.Object, finalizerName string) error

RemoveFinalizerWithRetry removes a finalizer from any client.Object with retry and conflict handling

func (*VolumeControllerBase) RemovePVCFinalizersWithRetry

func (b *VolumeControllerBase) RemovePVCFinalizersWithRetry(ctx context.Context, pvc *corev1.PersistentVolumeClaim) error

RemovePVCFinalizersWithRetry removes finalizers from a PVC with retry logic to handle conflicts

func (*VolumeControllerBase) RemovePVFinalizersWithRetry

func (b *VolumeControllerBase) RemovePVFinalizersWithRetry(ctx context.Context, pv *corev1.PersistentVolume) error

RemovePVFinalizersWithRetry removes finalizers from a PV with retry logic to handle conflicts

func (*VolumeControllerBase) SetupGenericController

func (r *VolumeControllerBase) SetupGenericController(mgr ctrl.Manager, config ControllerSetupConfig, reconciler interface{}) error

SetupGenericController provides a fully generic controller setup pattern

func (*VolumeControllerBase) ShouldUpdateReadinessStatus

func (r *VolumeControllerBase) ShouldUpdateReadinessStatus(volumeObj VolumeObject, nfsReady, replicaSetReady bool) bool

ShouldUpdateReadinessStatus determines if a status update is needed based on the current status

func (*VolumeControllerBase) UpdateReadinessStatus

func (r *VolumeControllerBase) UpdateReadinessStatus(ctx context.Context, volumeObj VolumeObject, nfsReady, replicaSetReady bool,
	onReady func(ctx context.Context, volumeObj VolumeObject) error,
	onNotReady func(ctx context.Context, volumeObj VolumeObject) error) error

UpdateReadinessStatus updates the volume status based on NFS and ReplicaSet readiness

func (*VolumeControllerBase) UpdateStatusWithRetry

func (r *VolumeControllerBase) UpdateStatusWithRetry(ctx context.Context, obj client.Object, updateFn func(client.Object)) error

UpdateStatusWithRetry updates the status of any client.Object with retry and conflict handling

func (*VolumeControllerBase) UpdateVolumeStatus

func (r *VolumeControllerBase) UpdateVolumeStatus(volumeObj VolumeObject, nfsReady bool, phase string, message string) bool

UpdateVolumeStatus updates the status fields and returns true if any field was changed

func (*VolumeControllerBase) UpdateVolumeStatusSimple

func (r *VolumeControllerBase) UpdateVolumeStatusSimple(volumeObj VolumeObject, phase string, message string) bool

UpdateVolumeStatusSimple updates basic status fields (phase and message) and returns true if any field was changed

func (*VolumeControllerBase) WaitForPodsToTerminate

func (b *VolumeControllerBase) WaitForPodsToTerminate(ctx context.Context, volume VolumeObject, referenceValue string)

WaitForPodsToTerminate waits for all pods related to a volume to fully terminate before proceeding with PVC deletion to avoid stuck pod termination

type VolumeObject

type VolumeObject interface {
	client.Object
	// GetVolumeSpec returns the common volume specification
	GetVolumeSpec() *svv1alpha1.VolumeSpecBase
	// GetPhase returns the current phase
	GetPhase() string
	// SetPhase sets the current phase
	SetPhase(phase string)
	// GetMessage returns the current message
	GetMessage() string
	// SetMessage sets the current message
	SetMessage(message string)
	// GetNfsServerAddress returns the NFS server address
	GetNfsServerAddress() string
	// SetNfsServerAddress sets the NFS server address
	SetNfsServerAddress(address string)
	// GetPersistentVolumeClaimName returns the PVC name
	GetPersistentVolumeClaimName() string
	// SetPersistentVolumeClaimName sets the PVC name
	SetPersistentVolumeClaimName(name string)
	// GetPersistentVolumeName returns the PV name
	GetPersistentVolumeName() string
	// SetPersistentVolumeName sets the PV name
	SetPersistentVolumeName(name string)
	// GetServiceName returns the service name
	GetServiceName() string
	// SetServiceName sets the service name
	SetServiceName(name string)
}

VolumeObject represents a common interface for volume-like objects

type VolumeReconcileConfig

type VolumeReconcileConfig struct {
	VolumeObjFactory       func() VolumeObject
	APIVersion             string
	Kind                   string
	FinalizerName          string
	Namespace              string // The namespace to use for resource creation
	CreateReadyCallback    func() func(context.Context, VolumeObject) error
	CreateNotReadyCallback func() func(context.Context, VolumeObject) error
}

VolumeReconcileConfig holds the configuration for generic volume reconciliation

type VolumeRef

type VolumeRef struct {
	Name      string
	Namespace string
	IsCluster bool // true for ClusterSharedVolume, false for SharedVolume
}

VolumeRef represents a reference to either a SharedVolume or ClusterSharedVolume

Jump to

Keyboard shortcuts

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