@@ -260,12 +260,11 @@ func (r *RuleS2SReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
260
260
missingAddressGroupsMsg = fmt .Sprintf ("TargetService '%s' has no address groups" , targetService .Name )
261
261
}
262
262
263
- // Update status with error condition
264
263
meta .SetStatusCondition (& ruleS2S .Status .Conditions , metav1.Condition {
265
264
Type : netguardv1alpha1 .ConditionReady ,
266
- Status : metav1 .ConditionFalse ,
267
- Reason : "NoAddressGroups " ,
268
- Message : missingAddressGroupsMsg ,
265
+ Status : metav1 .ConditionTrue ,
266
+ Reason : "ValidConfiguration " ,
267
+ Message : fmt . Sprintf ( "Rule is valid but inactive: %s" , missingAddressGroupsMsg ) ,
269
268
})
270
269
if err := UpdateStatusWithRetry (ctx , r .Client , ruleS2S , DefaultMaxRetries ); err != nil {
271
270
logger .Error (err , "Failed to update RuleS2S status" )
@@ -300,22 +299,21 @@ func (r *RuleS2SReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ct
300
299
serviceName = fmt .Sprintf ("target service '%s'" , targetService .Name )
301
300
}
302
301
303
- errorMsg := fmt .Sprintf ("No ports defined for the %s (traffic direction: %s)" ,
302
+ infoMsg := fmt .Sprintf ("No ports defined for the %s (traffic direction: %s)" ,
304
303
serviceName , ruleS2S .Spec .Traffic )
305
304
306
- // Update status with error condition
307
305
meta .SetStatusCondition (& ruleS2S .Status .Conditions , metav1.Condition {
308
306
Type : netguardv1alpha1 .ConditionReady ,
309
- Status : metav1 .ConditionFalse ,
310
- Reason : "NoPorts " ,
311
- Message : errorMsg ,
307
+ Status : metav1 .ConditionTrue ,
308
+ Reason : "ValidConfiguration " ,
309
+ Message : fmt . Sprintf ( "Rule is valid but inactive: %s" , infoMsg ) ,
312
310
})
313
311
if err := UpdateStatusWithRetry (ctx , r .Client , ruleS2S , DefaultMaxRetries ); err != nil {
314
312
logger .Error (err , "Failed to update RuleS2S status" )
315
313
}
316
314
317
315
// Логируем информацию
318
- logger .Info (errorMsg , "traffic" , ruleS2S .Spec .Traffic )
316
+ logger .Info (infoMsg , "traffic" , ruleS2S .Spec .Traffic )
319
317
320
318
// Возвращаем пустой Result без RequeueAfter
321
319
return ctrl.Result {}, nil
0 commit comments