Skip to content
This repository was archived by the owner on Dec 2, 2025. It is now read-only.

Commit e9afedd

Browse files
authored
fix: removing reconciliation status (#82)
* fix: removing reconciliation status * using the right version
1 parent 3165b5b commit e9afedd

File tree

5 files changed

+14
-16
lines changed

5 files changed

+14
-16
lines changed

controllers/componentsubscription_controller.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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-
}

docs/release_notes/v0.10.0.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Release 0.10.0
2+
3+
- integrate proposals from Soule (#85)
4+
- fix: removing reconciliation status #82
5+
- fix: add missing role (#81)
6+
- Create dependabot.yml (#78)

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ require (
2727
github.com/Masterminds/semver v1.5.0
2828
github.com/Masterminds/semver/v3 v3.2.1
2929
github.com/distribution/distribution/v3 v3.0.0-20230327091844-0c958010ace2
30-
github.com/fluxcd/pkg/apis/event v0.5.2
3130
github.com/fluxcd/pkg/apis/meta v1.1.2
3231
github.com/fluxcd/pkg/runtime v0.35.0
3332
github.com/go-logr/logr v1.2.4
3433
github.com/open-component-model/ocm v0.4.0
35-
github.com/open-component-model/ocm-controller v0.16.0
34+
github.com/open-component-model/ocm-controller v0.16.1
3635
github.com/stretchr/testify v1.8.4
3736
k8s.io/api v0.28.1
3837
k8s.io/apimachinery v0.28.1
@@ -127,6 +126,7 @@ require (
127126
github.com/evanphx/json-patch/v5 v5.6.0 // indirect
128127
github.com/fluxcd/helm-controller/api v0.36.0 // indirect
129128
github.com/fluxcd/kustomize-controller/api v1.0.0-rc.1 // indirect
129+
github.com/fluxcd/pkg/apis/event v0.5.2 // indirect
130130
github.com/fluxcd/pkg/apis/kustomize v1.1.1 // indirect
131131
github.com/fsnotify/fsnotify v1.6.0 // indirect
132132
github.com/fvbommel/sortorder v1.1.0 // indirect

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1178,8 +1178,8 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI=
11781178
github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M=
11791179
github.com/open-component-model/ocm v0.4.0 h1:S+rPJGoDnSvxhBn3QS2HXURxugTjCM4XWEJLZSaH6Ek=
11801180
github.com/open-component-model/ocm v0.4.0/go.mod h1:7RAqaUMmA4BlwW5ZEUBm8amWIb1TL9FhNigNXQ6wiu0=
1181-
github.com/open-component-model/ocm-controller v0.16.0 h1:yhZI95pg/DVs59RwOl41xcePaEVQMZDx0P5CKhhebqc=
1182-
github.com/open-component-model/ocm-controller v0.16.0/go.mod h1:lYax3VEjWAZ7qEr90opJQl+qm/gO3wIeoz1WSEdje2c=
1181+
github.com/open-component-model/ocm-controller v0.16.1 h1:Vr04cTivp/kBYktTwDMG4FgmpIS+DdgxX1QnBdBp/hA=
1182+
github.com/open-component-model/ocm-controller v0.16.1/go.mod h1:lYax3VEjWAZ7qEr90opJQl+qm/gO3wIeoz1WSEdje2c=
11831183
github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
11841184
github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=
11851185
github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s=

pkg/version/release.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
package version
66

77
// ReleaseVersion is the version number in semver format "vX.Y.Z", prefixed with "v".
8-
var ReleaseVersion = "v0.9.2"
8+
var ReleaseVersion = "v0.10.0"
99

1010
// ReleaseCandidate is the release candidate ID in format "rc.X", which will be appended to the release version.
1111
var ReleaseCandidate = "rc.1"

0 commit comments

Comments
 (0)