@@ -11,12 +11,9 @@ import (
1111 "time"
1212
1313 "github.com/Masterminds/semver/v3"
14- eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1"
1514 "github.com/fluxcd/pkg/apis/meta"
16- "github.com/fluxcd/pkg/runtime/conditions"
1715 "github.com/fluxcd/pkg/runtime/patch"
1816 rreconcile "github.com/fluxcd/pkg/runtime/reconcile"
19- "github.com/open-component-model/ocm-controller/pkg/event"
2017 "github.com/open-component-model/ocm-controller/pkg/status"
2118 corev1 "k8s.io/api/core/v1"
2219 apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -214,7 +211,7 @@ func (r *ComponentSubscriptionReconciler) reconcile(ctx context.Context, obj *v1
214211
215212 // Because of the predicate, this subscription will be reconciled again once there is an update to its status field.
216213 if version == obj .Status .LastAppliedVersion {
217- r . markAsDone ( obj )
214+ status . MarkReady ( r . EventRecorder , obj , "Reconciliation success" )
218215
219216 return ctrl.Result {RequeueAfter : obj .GetRequeueAfter ()}, nil
220217 }
@@ -241,7 +238,7 @@ func (r *ComponentSubscriptionReconciler) reconcile(ctx context.Context, obj *v1
241238 }
242239
243240 if latestSourceComponentVersion .LessThan (lastAppliedVersion ) || latestSourceComponentVersion .Equal (lastAppliedVersion ) {
244- r . markAsDone ( obj )
241+ status . MarkReady ( r . EventRecorder , obj , "Reconciliation success" )
245242
246243 return ctrl.Result {RequeueAfter : obj .GetRequeueAfter ()}, nil
247244 }
@@ -281,13 +278,8 @@ func (r *ComponentSubscriptionReconciler) reconcile(ctx context.Context, obj *v1
281278 // Update the replicated version to the latest version
282279 obj .Status .LastAppliedVersion = latestSourceComponentVersion .Original ()
283280
284- r . markAsDone ( obj )
281+ status . MarkReady ( r . EventRecorder , obj , "Reconciliation success" )
285282
286283 // Always requeue to constantly check for new versions.
287284 return ctrl.Result {RequeueAfter : obj .GetRequeueAfter ()}, nil
288285}
289-
290- func (r * ComponentSubscriptionReconciler ) markAsDone (obj * v1alpha1.ComponentSubscription ) {
291- conditions .MarkTrue (obj , meta .ReadyCondition , meta .SucceededReason , "Reconciliation success" )
292- event .New (r .EventRecorder , obj , eventv1 .EventSeverityInfo , "Reconciliation success" , nil )
293- }
0 commit comments