forked from openservicemesh/osm
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtypes.go
102 lines (72 loc) · 3.27 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
// Package configurator implements the Configurator interface that provides APIs to retrieve OSM control plane configurations.
package configurator
import (
"time"
corev1 "k8s.io/api/core/v1"
"k8s.io/client-go/tools/cache"
configv1alpha2 "github.com/openservicemesh/osm/pkg/apis/config/v1alpha2"
"github.com/openservicemesh/osm/pkg/auth"
"github.com/openservicemesh/osm/pkg/logger"
)
var (
log = logger.New("configurator")
)
// client is the type used to represent the Kubernetes client for the config.openservicemesh.io API group
type client struct {
osmNamespace string
informer cache.SharedIndexInformer
cache cache.Store
meshConfigName string
}
// Configurator is the controller interface for K8s namespaces
type Configurator interface {
// GetMeshConfig returns the MeshConfig resource corresponding to the control plane
GetMeshConfig() configv1alpha2.MeshConfig
// GetOSMNamespace returns the namespace in which OSM controller pod resides
GetOSMNamespace() string
// GetMeshConfigJSON returns the MeshConfig in pretty JSON (human readable)
GetMeshConfigJSON() (string, error)
// IsPermissiveTrafficPolicyMode determines whether we are in "allow-all" mode or SMI policy (block by default) mode
IsPermissiveTrafficPolicyMode() bool
// IsEgressEnabled determines whether egress is globally enabled in the mesh or not
IsEgressEnabled() bool
// IsDebugServerEnabled determines whether osm debug HTTP server is enabled
IsDebugServerEnabled() bool
// IsTracingEnabled returns whether tracing is enabled
IsTracingEnabled() bool
// GetTracingHost is the host to which we send tracing spans
GetTracingHost() string
// GetTracingPort returns the tracing listener port
GetTracingPort() uint32
// GetTracingEndpoint returns the collector endpoint
GetTracingEndpoint() string
// GetMaxDataPlaneConnections returns the max data plane connections allowed, 0 if disabled
GetMaxDataPlaneConnections() int
// GetOsmLogLevel returns the configured OSM log level
GetOSMLogLevel() string
// GetSidecarLogLevel returns the sidecar log level
GetSidecarLogLevel() string
// GetSidecarClass returns the sidecar class
GetSidecarClass() string
// GetSidecarImage returns the sidecar image
GetSidecarImage() string
// GetSidecarWindowsImage returns the sidecar image
GetSidecarWindowsImage() string
// GetInitContainerImage returns the init container image
GetInitContainerImage() string
// GetServiceCertValidityPeriod returns the validity duration for service certificates
GetServiceCertValidityPeriod() time.Duration
// GetCertKeyBitSize returns the certificate key bit size
GetCertKeyBitSize() int
// IsPrivilegedInitContainer determines whether init containers should be privileged
IsPrivilegedInitContainer() bool
// GetConfigResyncInterval returns the duration for resync interval.
// If error or non-parsable value, returns 0 duration
GetConfigResyncInterval() time.Duration
// GetProxyResources returns the `Resources` configured for proxies, if any
GetProxyResources() corev1.ResourceRequirements
// GetInboundExternalAuthConfig returns the External Authentication configuration for incoming traffic, if any
GetInboundExternalAuthConfig() auth.ExtAuthConfig
// GetFeatureFlags returns OSM's feature flags
GetFeatureFlags() configv1alpha2.FeatureFlags
}