This repository has been archived by the owner on Jul 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 277
/
types.go
54 lines (47 loc) · 1.97 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
// Package ads implements Envoy's Aggregated Discovery Service (ADS).
package ads
import (
"sync"
"time"
xds_discovery "github.com/envoyproxy/go-control-plane/envoy/service/discovery/v3"
"github.com/envoyproxy/go-control-plane/pkg/cache/types"
cachev3 "github.com/envoyproxy/go-control-plane/pkg/cache/v3"
serverv3 "github.com/envoyproxy/go-control-plane/pkg/server/v3"
"github.com/openservicemesh/osm/pkg/catalog"
"github.com/openservicemesh/osm/pkg/certificate"
"github.com/openservicemesh/osm/pkg/configurator"
"github.com/openservicemesh/osm/pkg/envoy"
"github.com/openservicemesh/osm/pkg/envoy/registry"
"github.com/openservicemesh/osm/pkg/k8s"
"github.com/openservicemesh/osm/pkg/logger"
"github.com/openservicemesh/osm/pkg/messaging"
"github.com/openservicemesh/osm/pkg/workerpool"
)
var (
log = logger.New("envoy/ads")
)
// Server implements the Envoy xDS Aggregate Discovery Services
type Server struct {
catalog catalog.MeshCataloger
proxyRegistry *registry.ProxyRegistry
xdsHandlers map[envoy.TypeURI]func(catalog.MeshCataloger, *envoy.Proxy, *xds_discovery.DiscoveryRequest, configurator.Configurator, certificate.Manager, *registry.ProxyRegistry) ([]types.Resource, error)
xdsLog map[certificate.CommonName]map[envoy.TypeURI][]time.Time
xdsMapLogMutex sync.Mutex
osmNamespace string
cfg configurator.Configurator
certManager certificate.Manager
ready bool
workqueues *workerpool.WorkerPool
kubecontroller k8s.Controller
// ---
// SnapshotCache implementation structrues below
cacheEnabled bool
ch cachev3.SnapshotCache
srv serverv3.Server
// When snapshot cache is enabled, we (currently) don't keep track of proxy information, however different
// config versions have to be provided to the cache as we keep adding snapshots. The following map
// tracks at which version we are at given a proxy UUID
configVerMutex sync.Mutex
configVersion map[string]uint64
msgBroker *messaging.Broker
}