@@ -53,21 +53,18 @@ func (r *ConsoleApplicationReconciler) Reconcile(ctx context.Context, req ctrl.R
53
53
consoleApplication := & appsv1alpha1.ConsoleApplication {}
54
54
if err := r .Get (ctx , req .NamespacedName , consoleApplication ); err != nil {
55
55
if errors .IsNotFound (err ) {
56
+ // Request object not found, could have been deleted after reconcile request.
56
57
return NoRequeue ()
57
58
}
58
- logger .Error (err , "Unable to fetch ConsoleApplication CR" )
59
- SetDegraded (consoleApplication , appsv1alpha1 .ReasonOperatorResourceNotAvailable .String (), err .Error ())
60
- if err := r .Status ().Update (ctx , consoleApplication ); err != nil {
61
- return RequeueWithError (err )
62
- }
59
+ // Error reading the object - requeue the request.
63
60
return RequeueOnError (err )
64
61
}
65
62
66
63
if consoleApplication .Status .Conditions == nil {
67
64
consoleApplication .Status .Conditions = make ([]metav1.Condition , 0 )
68
65
SetStarted (consoleApplication )
69
66
if err := r .Status ().Update (ctx , consoleApplication ); err != nil {
70
- return RequeueWithError (err )
67
+ return RequeueOnError (err )
71
68
}
72
69
}
73
70
@@ -80,10 +77,9 @@ func (r *ConsoleApplicationReconciler) Reconcile(ctx context.Context, req ctrl.R
80
77
Namespace : req .Namespace ,
81
78
Name : secretResourceName ,
82
79
}, secret ); err != nil {
83
- logger .Error (err , "Unable To Find Secret Resource" )
84
80
SetFailed (consoleApplication , appsv1alpha1 .ReasonSecretResourceNotFound .String (), err .Error ())
85
81
if err := r .Status ().Update (ctx , consoleApplication ); err != nil {
86
- return RequeueWithError (err )
82
+ return RequeueOnError (err )
87
83
}
88
84
return NoRequeue ()
89
85
}
@@ -98,13 +94,13 @@ func (r *ConsoleApplicationReconciler) Reconcile(ctx context.Context, req ctrl.R
98
94
99
95
SetGitServiceCondition (consoleApplication , gStatus , gReason .String ())
100
96
if err := r .Status ().Update (ctx , consoleApplication ); err != nil {
101
- return RequeueWithError (err )
97
+ return RequeueOnError (err )
102
98
}
103
99
104
100
if gStatus != metav1 .ConditionTrue {
105
101
SetFailed (consoleApplication , gReason .String (), fmt .Sprintf ("Git Repository Not Reachable: %s" , gReason .String ()))
106
102
if err := r .Status ().Update (ctx , consoleApplication ); err != nil {
107
- return RequeueWithError (err )
103
+ return RequeueOnError (err )
108
104
}
109
105
return NoRequeue ()
110
106
}
@@ -114,7 +110,7 @@ func (r *ConsoleApplicationReconciler) Reconcile(ctx context.Context, req ctrl.R
114
110
logger .Info ("All done!" )
115
111
SetSucceeded (consoleApplication )
116
112
if err := r .Status ().Update (ctx , consoleApplication ); err != nil {
117
- return RequeueWithError (err )
113
+ return RequeueOnError (err )
118
114
}
119
115
return NoRequeue ()
120
116
}
0 commit comments