forked from joeholley/supergloo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathoptions.go
164 lines (141 loc) · 3.63 KB
/
options.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
package options
import (
"context"
"time"
glooOptions "github.com/solo-io/gloo/projects/gloo/cli/pkg/cmd/options"
"github.com/solo-io/solo-kit/pkg/api/v1/resources/core"
v1 "github.com/solo-io/supergloo/pkg/api/v1"
)
type Options struct {
// common
Ctx context.Context
Interactive bool
OutputType string
Metadata core.Metadata
PrintKubeYaml bool
Init Init
Install Install
Uninstall Uninstall
CreateRoutingRule CreateRoutingRule
CreateSecurityRule CreateSecurityRule
CreateTlsSecret CreateTlsSecret
CreateAwsSecret CreateAwsSecret
EditUpstream EditUpstream
GetMeshIngress GetMeshIngress
SetRootCert SetRootCert
SetStats SetStats
RegisterAppMesh RegisterAppMesh
}
type Init struct {
HelmChartOverride string
HelmValues string
InstallNamespace string
ReleaseVersion string
DryRun bool
}
type InstallationNamespace struct {
Istio string
Linkerd string
Gloo string
}
type Install struct {
Update bool // if install exists and is enabled, update with new opts
InstallationNamespace InstallationNamespace
IstioInstall v1.IstioInstall
LinkerdInstall v1.LinkerdInstall
GlooIngressInstall v1.GlooInstall
MeshIngress MeshIngressInstall
}
type MeshIngressInstall struct {
Meshes ResourceRefsValue
}
type Uninstall struct {
Metadata core.Metadata
}
type CreateRoutingRule struct {
SourceSelector Selector
DestinationSelector Selector
TargetMesh ResourceRefValue
RequestMatchers RequestMatchersValue
RoutingRuleSpec RoutingRuleSpec
}
type CreateSecurityRule struct {
SourceSelector Selector
DestinationSelector Selector
TargetMesh ResourceRefValue
AllowedMethods []string
AllowedPaths []string
}
type RequestMatcher struct {
PathPrefix string `json:"path_prefix"`
PathExact string `json:"path_exact"`
PathRegex string `json:"path_regex"`
Methods []string `json:"methods"`
HeaderMatcher map[string]string `json:"header_matchers"`
}
type Selector struct {
SelectedUpstreams ResourceRefsValue
SelectedNamespaces []string
SelectedLabels MapStringStringValue
}
// no implemented specs yet
type RoutingRuleSpec struct {
TrafficShifting TrafficShiftingValue
FaultInjection FaultInjection
Retries Retries
}
type Retries struct {
MaxRetries MaxRetries
RetryBudget v1.RetryBudget
}
type MaxRetries struct {
Attempts uint32
PerTryTimeout time.Duration
RetryOn string
}
type FaultInjection struct {
Percent float64
Abort FaultInjectionAbort
Delay FaultInjectionDelay
}
type FaultInjectionDelay struct {
Fixed time.Duration
}
type FaultInjectionAbort struct {
Http v1.FaultInjection_Abort_HttpStatus
}
type CreateTlsSecret struct {
RootCaFilename string
PrivateKeyFilename string
CertChainFilename string
CaCertFilename string
}
type CreateAwsSecret struct {
CredentialsFileLocation string
CredentialsFileProfile string
AccessKeyId string
SecretAccessKey string
}
type SetRootCert struct {
TargetMesh ResourceRefValue
TlsSecret ResourceRefValue
}
type EditUpstream struct {
MtlsMesh ResourceRefValue
}
type SetStats struct {
TargetMesh ResourceRefValue
PrometheusConfigMaps ResourceRefsValue
}
type GetMeshIngress struct {
Proxy glooOptions.Proxy
Target ResourceRefValue
}
type RegisterAppMesh struct {
Region string
Secret ResourceRefValue
EnableAutoInjection string
ConfigMap ResourceRefValue
PodSelector Selector
VirtualNodeLabel string
}