Skip to content

Commit 4c29577

Browse files
abaysClaude (Anthropic)
andcommitted
[OSPRH-20468] Improve consistency of condition severity usage
Use consistent condition severity across repeated patterns found in our operators, and otherwise use an appropriate severity for conditions unique to each operator. Jira: https://issues.redhat.com/browse/OSPRH-20468 Co-authored-by: Claude (Anthropic) <[email protected]>
1 parent eead513 commit 4c29577

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

controllers/tempest_controller.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,13 @@ func (r *TempestReconciler) Reconcile(ctx context.Context, req ctrl.Request) (re
253253
nad, err := nad.GetNADWithName(ctx, helper, netAtt, instance.Namespace)
254254
if err != nil {
255255
if k8s_errors.IsNotFound(err) {
256+
// Since the net-attach-def CR should have been manually created by the user and referenced in the spec,
257+
// we treat this as a warning because it means that the service will not be able to start.
256258
Log.Info(fmt.Sprintf("network-attachment-definition %s not found", netAtt))
257259
instance.Status.Conditions.Set(condition.FalseCondition(
258260
condition.NetworkAttachmentsReadyCondition,
259-
condition.RequestedReason,
260-
condition.SeverityInfo,
261+
condition.ErrorReason,
262+
condition.SeverityWarning,
261263
condition.NetworkAttachmentsReadyWaitingMessage,
262264
netAtt))
263265
return ctrl.Result{RequeueAfter: time.Second * 10}, nil

controllers/tobiko_controller.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,11 +226,13 @@ func (r *TobikoReconciler) Reconcile(ctx context.Context, req ctrl.Request) (res
226226
nad, err := nad.GetNADWithName(ctx, helper, netAtt, instance.Namespace)
227227
if err != nil {
228228
if k8s_errors.IsNotFound(err) {
229+
// Since the net-attach-def CR should have been manually created by the user and referenced in the spec,
230+
// we treat this as a warning because it means that the service will not be able to start.
229231
Log.Info(fmt.Sprintf("network-attachment-definition %s not found", netAtt))
230232
instance.Status.Conditions.Set(condition.FalseCondition(
231233
condition.NetworkAttachmentsReadyCondition,
232-
condition.RequestedReason,
233-
condition.SeverityInfo,
234+
condition.ErrorReason,
235+
condition.SeverityWarning,
234236
condition.NetworkAttachmentsReadyWaitingMessage,
235237
netAtt))
236238
return ctrl.Result{RequeueAfter: time.Second * 10}, nil

0 commit comments

Comments
 (0)