Documentation
¶
Overview ¶
Package persistentvolumeclaim contains all the logic to reconcile and build PVCS
Index ¶
- Variables
- func BelongToInstance(cluster *apiv1.Cluster, instanceName, pvcName string) bool
- func Build(cluster *apiv1.Cluster, configuration *CreateConfiguration) (*corev1.PersistentVolumeClaim, error)
- func CreateInstancePVCs(ctx context.Context, c client.Client, cluster *apiv1.Cluster, serial int) error
- func EnrichStatus(ctx context.Context, cluster *apiv1.Cluster, runningInstances []corev1.Pod, ...)
- func EnsureInstancePVCGroupIsDeleted(ctx context.Context, c client.Client, cluster *apiv1.Cluster, name string, ...) error
- func FilterByPodSpec(pvcs []corev1.PersistentVolumeClaim, instanceSpec corev1.PodSpec) []corev1.PersistentVolumeClaim
- func GetName(instanceName string, role utils.PVCRole) string
- func InstanceHasMissingMounts(cluster *apiv1.Cluster, instance *corev1.Pod) bool
- func IsUsedByPodSpec(podSpec corev1.PodSpec, pvcNames ...string) bool
- func Reconcile(ctx context.Context, c client.Client, cluster *apiv1.Cluster, ...) (ctrl.Result, error)
- type CreateConfiguration
- type PVCStatus
Constants ¶
This section is empty.
Variables ¶
var ErrorInvalidSize = fmt.Errorf("invalid storage size")
ErrorInvalidSize is raised when the size specified by the user is not valid and can't be specified in a PVC declaration
Functions ¶
func BelongToInstance ¶ added in v1.18.4
BelongToInstance returns a boolean indicating if that given PVC belongs to an instance
func Build ¶
func Build( cluster *apiv1.Cluster, configuration *CreateConfiguration, ) (*corev1.PersistentVolumeClaim, error)
Build spec of a PVC, given its name and the storage configuration TODO: this logic eventually should be moved inside reconcile
func CreateInstancePVCs ¶ added in v1.18.4
func CreateInstancePVCs( ctx context.Context, c client.Client, cluster *apiv1.Cluster, serial int, ) error
CreateInstancePVCs creates the expected pvcs for the instance
func EnrichStatus ¶
func EnrichStatus( ctx context.Context, cluster *apiv1.Cluster, runningInstances []corev1.Pod, jobs []batchv1.Job, managedPVCs []corev1.PersistentVolumeClaim, )
EnrichStatus obtains and classifies the current status of each managed PVC
func EnsureInstancePVCGroupIsDeleted ¶ added in v1.18.4
func EnsureInstancePVCGroupIsDeleted( ctx context.Context, c client.Client, cluster *apiv1.Cluster, name string, namespace string, ) error
EnsureInstancePVCGroupIsDeleted ensures that all the expected pvc for a given instance are deleted
func FilterByPodSpec ¶ added in v1.18.4
func FilterByPodSpec( pvcs []corev1.PersistentVolumeClaim, instanceSpec corev1.PodSpec, ) []corev1.PersistentVolumeClaim
FilterByPodSpec returns all the corev1.PersistentVolumeClaim that are used inside the podSpec
func InstanceHasMissingMounts ¶ added in v1.18.4
InstanceHasMissingMounts returns true if the instance has expected PVCs that are not mounted
func IsUsedByPodSpec ¶
IsUsedByPodSpec checks if the given pod spec is using the PVCs
Types ¶
type CreateConfiguration ¶
type CreateConfiguration struct {
Status PVCStatus
NodeSerial int
Role utils.PVCRole
Storage apiv1.StorageConfiguration
Source *corev1.TypedLocalObjectReference
}
CreateConfiguration specifies how a PVC should be created
type PVCStatus ¶
type PVCStatus = string
PVCStatus describes the PVC phase
const ( // StatusAnnotationName is an annotation that shows the current status of the PVC. // The status can be "initializing", "ready" or "detached" StatusAnnotationName = specs.MetadataNamespace + "/pvcStatus" // StatusInitializing is the annotation value for PVC initializing status StatusInitializing PVCStatus = "initializing" // StatusReady is the annotation value for PVC ready status StatusReady PVCStatus = "ready" // StatusDetached is the annotation value for PVC detached status StatusDetached PVCStatus = "detached" )