File tree Expand file tree Collapse file tree 4 files changed +4
-27
lines changed
internal/mode/static/nginx/config Expand file tree Collapse file tree 4 files changed +4
-27
lines changed Original file line number Diff line number Diff line change @@ -107,22 +107,6 @@ func (g GeneratorImpl) Generate(conf dataplane.Configuration) []file.File {
107
107
return files
108
108
}
109
109
110
- func (g GeneratorImpl ) getExecuteFuncs (generator policies.Generator ) []executeFunc {
111
- return []executeFunc {
112
- executeMainConfig ,
113
- executeBaseHTTPConfig ,
114
- g .newExecuteServersFunc (generator ),
115
- g .executeUpstreams ,
116
- executeSplitClients ,
117
- executeMaps ,
118
- executeTelemetry ,
119
- g .executeStreamServers ,
120
- g .executeStreamUpstreams ,
121
- executeStreamMaps ,
122
- executeVersion ,
123
- }
124
- }
125
-
126
110
func generatePEM (id dataplane.SSLKeyPairID , cert []byte , key []byte ) file.File {
127
111
c := make ([]byte , 0 , len (cert )+ len (key )+ 1 )
128
112
c = append (c , cert ... )
@@ -179,6 +163,7 @@ func (g GeneratorImpl) runExecuteFuncs(
179
163
180
164
func (g GeneratorImpl ) getExecuteFuncs (generator policies.Generator ) []executeFunc {
181
165
return []executeFunc {
166
+ executeMainConfig ,
182
167
executeBaseHTTPConfig ,
183
168
g .newExecuteServersFunc (generator ),
184
169
g .executeUpstreams ,
Original file line number Diff line number Diff line change @@ -175,20 +175,12 @@ func TestGenerate(t *testing.T) {
175
175
expString := "{}"
176
176
g .Expect (string (files [2 ].Content )).To (Equal (expString ))
177
177
178
- << << << < HEAD
179
- g .Expect (files [3 ].Path ).To (Equal ("/etc/nginx/main-includes/main.conf" ))
180
-
181
- mainCfg := string (files [3 ].Content )
182
- g .Expect (mainCfg ).To (ContainSubstring ("load_module modules/ngx_otel_module.so;" ))
183
- g .Expect (mainCfg ).To (ContainSubstring ("error_log stderr debug;" ))
184
- == == == =
185
178
// snippet include files
186
179
// content is not checked in this test.
187
180
g .Expect (files [3 ].Path ).To (Equal ("/etc/nginx/includes/http_snippet1.conf" ))
188
181
g .Expect (files [4 ].Path ).To (Equal ("/etc/nginx/includes/http_snippet2.conf" ))
189
182
g .Expect (files [5 ].Path ).To (Equal ("/etc/nginx/includes/main_snippet1.conf" ))
190
183
g .Expect (files [6 ].Path ).To (Equal ("/etc/nginx/includes/main_snippet2.conf" ))
191
- >> >> >> > 401e19 f7 (Apply configuration of SnippetsFilters to NGINX (#2604 ))
192
184
193
185
g .Expect (files [7 ].Path ).To (Equal ("/etc/nginx/main-includes/main.conf" ))
194
186
mainConfStr := string (files [7 ].Content )
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ func executeMainConfig(conf dataplane.Configuration) []executeResult {
25
25
26
26
results := make ([]executeResult , 0 , len (includes )+ 1 )
27
27
results = append (results , executeResult {
28
- dest : mainIncludeFile ,
28
+ dest : mainIncludesConfigFile ,
29
29
data : helpers .MustExecuteTemplate (mainConfigTemplate , mc ),
30
30
})
31
31
results = append (results , createIncludeExecuteResults (includes )... )
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ func TestExecuteMainConfig_Telemetry(t *testing.T) {
46
46
47
47
res := executeMainConfig (test .conf )
48
48
g .Expect (res ).To (HaveLen (1 ))
49
- g .Expect (res [0 ].dest ).To (Equal (mainIncludeFile ))
49
+ g .Expect (res [0 ].dest ).To (Equal (mainIncludesConfigFile ))
50
50
if test .expLoadModuleDirective {
51
51
g .Expect (res [0 ].data ).To (ContainSubstring (loadModuleDirective ))
52
52
} else {
@@ -105,5 +105,5 @@ func TestExecuteMainConfig_Snippets(t *testing.T) {
105
105
g .Expect (res [2 ].dest ).To (Equal ("/etc/nginx/includes/snippet3.conf" ))
106
106
g .Expect (string (res [2 ].data )).To (ContainSubstring ("contents3" ))
107
107
108
- g .Expect (res [3 ].dest ).To (Equal (mainIncludeFile ))
108
+ g .Expect (res [3 ].dest ).To (Equal (mainIncludesConfigFile ))
109
109
}
You can’t perform that action at this time.
0 commit comments