This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
/
types.go
67 lines (57 loc) · 2.7 KB
/
types.go
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
58
59
60
61
62
63
64
65
66
67
package informers
import (
"errors"
"time"
"k8s.io/client-go/tools/cache"
)
// InformerKey stores the different Informers we keep for K8s resources
type InformerKey string
const (
// InformerKeyNamespace is the InformerKey for a Namespace informer
InformerKeyNamespace InformerKey = "Namespace"
// InformerKeyService is the InformerKey for a Service informer
InformerKeyService InformerKey = "Service"
// InformerKeyPod is the InformerKey for a Pod informer
InformerKeyPod InformerKey = "Pod"
// InformerKeyEndpoints is the InformerKey for a Endpoints informer
InformerKeyEndpoints InformerKey = "Endpoints"
// InformerKeyServiceAccount is the InformerKey for a ServiceAccount informer
InformerKeyServiceAccount InformerKey = "ServiceAccount"
// InformerKeyTrafficSplit is the InformerKey for a TrafficSplit informer
InformerKeyTrafficSplit InformerKey = "TrafficSplit"
// InformerKeyTrafficTarget is the InformerKey for a TrafficTarget informer
InformerKeyTrafficTarget InformerKey = "TrafficTarget"
// InformerKeyHTTPRouteGroup is the InformerKey for a HTTPRouteGroup informer
InformerKeyHTTPRouteGroup InformerKey = "HTTPRouteGroup"
// InformerKeyTCPRoute is the InformerKey for a TCPRoute informer
InformerKeyTCPRoute InformerKey = "TCPRoute"
// InformerKeyMeshConfig is the InformerKey for a MeshConfig informer
InformerKeyMeshConfig InformerKey = "MeshConfig"
// InformerKeyMeshRootCertificate is the InformerKey for a MeshRootCertificate informer
InformerKeyMeshRootCertificate InformerKey = "MeshRootCertificate"
// InformerKeyEgress is the InformerKey for a Egress informer
InformerKeyEgress InformerKey = "Egress"
// InformerKeyIngressBackend is the InformerKey for a IngressBackend informer
InformerKeyIngressBackend InformerKey = "IngressBackend"
// InformerKeyUpstreamTrafficSetting is the InformerKey for a UpstreamTrafficSetting informer
InformerKeyUpstreamTrafficSetting InformerKey = "UpstreamTrafficSetting"
// InformerKeyRetry is the InformerKey for a Retry informer
InformerKeyRetry InformerKey = "Retry"
)
const (
// DefaultKubeEventResyncInterval is the default resync interval for k8s events
// This is set to 0 because we do not need resyncs from k8s client, and have our
// own Ticker to turn on periodic resyncs.
DefaultKubeEventResyncInterval = 0 * time.Second
)
var (
errInitInformers = errors.New("informer not initialized")
errSyncingCaches = errors.New("failed initial cache sync for informers")
)
// InformerCollection is an abstraction around a set of informers
// initialized with the clients stored in its fields. This data
// type should only be passed around as a pointer
type InformerCollection struct {
informers map[InformerKey]cache.SharedIndexInformer
meshName string
}