@@ -126,23 +126,28 @@ func (iw *InstanceWatcherService) Watch(
126126func (iw * InstanceWatcherService ) ReparseConfigs (ctx context.Context ) {
127127 slog .DebugContext (ctx , "Reparsing all instance configurations" )
128128 for _ , instance := range iw .instanceCache {
129+ nginxConfigContext := & model.NginxConfigContext {}
130+ var parseErr error
129131 slog .DebugContext (
130132 ctx ,
131133 "Reparsing NGINX instance config" ,
132134 "instance_id" , instance .GetInstanceMeta ().GetInstanceId (),
133135 )
134136
135- nginxConfigContext , parseErr := iw .nginxConfigParser .Parse (ctx , instance )
136- if parseErr != nil {
137- slog .WarnContext (
138- ctx ,
139- "Failed to parse NGINX instance config" ,
140- "config_path" , instance .GetInstanceRuntime ().GetConfigPath (),
141- "instance_id" , instance .GetInstanceMeta ().GetInstanceId (),
142- "error" , parseErr ,
143- )
137+ if instance .GetInstanceMeta ().GetInstanceType () == mpi .InstanceMeta_INSTANCE_TYPE_NGINX ||
138+ instance .GetInstanceMeta ().GetInstanceType () == mpi .InstanceMeta_INSTANCE_TYPE_NGINX_PLUS {
139+ nginxConfigContext , parseErr = iw .nginxConfigParser .Parse (ctx , instance )
140+ if parseErr != nil {
141+ slog .WarnContext (
142+ ctx ,
143+ "Failed to parse NGINX instance config" ,
144+ "config_path" , instance .GetInstanceRuntime ().GetConfigPath (),
145+ "instance_id" , instance .GetInstanceMeta ().GetInstanceId (),
146+ "error" , parseErr ,
147+ )
144148
145- return
149+ return
150+ }
146151 }
147152
148153 iw .HandleNginxConfigContextUpdate (ctx , instance .GetInstanceMeta ().GetInstanceId (), nginxConfigContext )
0 commit comments