@@ -194,12 +194,12 @@ func (r *ResourceService) ApplyConfig(ctx context.Context, instanceID string) (*
194194 }
195195 }
196196
197- configContext , parseErr := r .ParseConfig (ctx , instance )
198- if parseErr != nil || configContext == nil {
197+ nginxConfigContext , parseErr := r .nginxConfigParser . Parse (ctx , instance )
198+ if parseErr != nil || nginxConfigContext == nil {
199199 return nil , fmt .Errorf ("failed to parse config %w" , parseErr )
200200 }
201201
202- datasource .UpdateNginxInstanceRuntime (instance , configContext )
202+ datasource .UpdateNginxInstanceRuntime (instance , nginxConfigContext )
203203
204204 slog .DebugContext (ctx , "Updated Instance Runtime after parsing config" , "instance" , instance .GetInstanceRuntime ())
205205
@@ -213,22 +213,14 @@ func (r *ResourceService) ApplyConfig(ctx context.Context, instanceID string) (*
213213 return nil , fmt .Errorf ("failed to reload NGINX %w" , reloadErr )
214214 }
215215
216- return configContext , nil
216+ return nginxConfigContext , nil
217217}
218218
219219func (r * ResourceService ) ParseConfig (ctx context.Context , instance * mpi.Instance ) (* model.NginxConfigContext , error ) {
220220 slog .DebugContext (ctx , "Parsing NGINX instance config" , "instance_id" , instance .GetInstanceMeta ().GetInstanceId ())
221221
222222 nginxConfigContext , parseErr := r .nginxConfigParser .Parse (ctx , instance )
223223 if parseErr != nil {
224- slog .WarnContext (
225- ctx ,
226- "Unable to parse NGINX instance config" ,
227- "config_path" , instance .GetInstanceRuntime ().GetConfigPath (),
228- "instance_id" , instance .GetInstanceMeta ().GetInstanceId (),
229- "error" , parseErr ,
230- )
231-
232224 return nil , parseErr
233225 }
234226
0 commit comments