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
package configmap
import (
"github.com/ankitrgadiya/operatorlib/pkg/interfaces"
"github.com/ankitrgadiya/operatorlib/pkg/meta"
corev1 "k8s.io/api/core/v1"
)
// GenConfigMapFunc defines a function which generates ConfigMap.
type GenConfigMapFunc func(Conf) (*corev1.ConfigMap, error)
// GenDataFunc defines a function which generates data (string map)
// for Configmap.
type GenDataFunc func() (map[string]string, error)
// GenBinaryDataFunc defines a function which generates binary data
// (map of string to byte slice) for Configmap.
type GenBinaryDataFunc func() (map[string][]byte, error)
type Conf struct {
Namespace string
Name string
Obj interfaces.Object
Reconcile interfaces.Reconcile
previousObject interfaces.Object
Owner interfaces.Object
OwnerReference bool
GenFinalizers meta.GenFinalizers
GenLabels meta.GenLabels
GenAnnotations meta.GenAnnotations
// 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.
GenConfigMapFunc
// GenDataFunc defines a function to generate data for Configmap
GenDataFunc
// GenBinaryDataFunc defines a function to generate binary data
// for Configmap
GenBinaryDataFunc
}