Skip to content
types.go 961 B
Newer Older
Timothee Gosselin's avatar
Timothee Gosselin committed
package pvc

import (
	"github.com/ankitrgadiya/operatorlib/pkg/interfaces"
	"github.com/ankitrgadiya/operatorlib/pkg/meta"

	corev1 "k8s.io/api/core/v1"
	"k8s.io/apimachinery/pkg/runtime"
Timothee Gosselin's avatar
Timothee Gosselin committed
)

type GenPVCFunc func(Conf) (*corev1.PersistentVolumeClaim, error)

Timothee Gosselin's avatar
Timothee Gosselin committed
type GenResourcesFunc func() (corev1.ResourceRequirements, error)
type GenAccessModesFunc func() ([]corev1.PersistentVolumeAccessMode, error)

Timothee Gosselin's avatar
Timothee Gosselin committed
type Conf struct {
	Owner          interfaces.Object
	Namespace      string
	Name           string
	OwnerReference bool
	Reconcile      interfaces.Reconcile
	previousObject runtime.Object
	Obj            interfaces.Object
	GenFinalizers  meta.GenFinalizers
	GenLabels      meta.GenLabels
	GenAnnotations meta.GenAnnotations
Timothee Gosselin's avatar
Timothee Gosselin committed
	GenPVCFunc
	StorageClassName *string
	GenResourcesFunc
	GenAccessModesFunc
}

type Mutate interface {
	meta.Mutate

	GenResources() (corev1.ResourceRequirements, error)
	GenAccessModes() ([]corev1.PersistentVolumeAccessMode, error)
}