Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package pvc
import (
"github.com/ankitrgadiya/operatorlib/pkg/interfaces"
"github.com/ankitrgadiya/operatorlib/pkg/meta"
"github.com/ankitrgadiya/operatorlib/pkg/operation"
corev1 "k8s.io/api/core/v1"
)
// GenConfigMapFunc defines a function which generates ConfigMap.
type GenPVCFunc func(Conf) (*corev1.PersistentVolumeClaim, error)
type GenResourcesFunc func(interfaces.Object) (corev1.ResourceRequirements, error)
type GenAccessModesFunc func(interfaces.Object) ([]corev1.PersistentVolumeAccessMode, error)
// Conf is used to pass parameters to functions in this package to
// perform operations on Configmap objects.
type Conf struct {
// Instance is the Owner object which manages the Configmap
Instance interfaces.Object
// Reconcile is the pointer to reconcile struct of owner object
interfaces.Reconcile
// Name of the Configmap
Name string
// Namespace of the Configmap
Namespace string
// GenLalebsFunc is used to generate labels for ObjectMeta
meta.GenLabelsFunc
// GenAnnotationsFunc is used to generate annotations for ObjectMeta
meta.GenAnnotationsFunc
// GenFinalizers is used to generate finalizers for ObjectMeta
meta.GenFinalizersFunc
// AppendLabels is used to determine if labels from Owner object
// are to be inherited
AppendLabels bool
// OwnerReference is used to determine if owner reference needs to
// be set on Configmap before creating it in cluster
OwnerReference bool
// MaybeUpdateFunc defines an update function with custom logic
// for Configmap update
operation.MaybeUpdateFunc
// AfterCreateFunc hook is called after creating the Configmap
operation.AfterCreateFunc
// AfterUpdateFunc hook is called after updating the Configmap
operation.AfterUpdateFunc
// AfterDeleteFunc hook is called after deleting the Configmap
operation.AfterDeleteFunc
// GenConfigMapFunc defines a function to generate the Configmap
// object. The package comes with default configmap generator
// function which is used by operation functions. By specifying
// this field, user can override the default function with a
// custom one.
GenPVCFunc
StorageClassName *string
GenResourcesFunc
GenAccessModesFunc
}