diff --git a/controllers/componentsubscription_controller.go b/controllers/componentsubscription_controller.go index cc28309..4d0bf2b 100644 --- a/controllers/componentsubscription_controller.go +++ b/controllers/componentsubscription_controller.go @@ -11,12 +11,9 @@ import ( "time" "github.com/Masterminds/semver/v3" - eventv1 "github.com/fluxcd/pkg/apis/event/v1beta1" "github.com/fluxcd/pkg/apis/meta" - "github.com/fluxcd/pkg/runtime/conditions" "github.com/fluxcd/pkg/runtime/patch" rreconcile "github.com/fluxcd/pkg/runtime/reconcile" - "github.com/open-component-model/ocm-controller/pkg/event" "github.com/open-component-model/ocm-controller/pkg/status" corev1 "k8s.io/api/core/v1" apierrors "k8s.io/apimachinery/pkg/api/errors" @@ -214,7 +211,7 @@ func (r *ComponentSubscriptionReconciler) reconcile(ctx context.Context, obj *v1 // Because of the predicate, this subscription will be reconciled again once there is an update to its status field. if version == obj.Status.LastAppliedVersion { - r.markAsDone(obj) + status.MarkReady(r.EventRecorder, obj, "Reconciliation success") return ctrl.Result{RequeueAfter: obj.GetRequeueAfter()}, nil } @@ -241,7 +238,7 @@ func (r *ComponentSubscriptionReconciler) reconcile(ctx context.Context, obj *v1 } if latestSourceComponentVersion.LessThan(lastAppliedVersion) || latestSourceComponentVersion.Equal(lastAppliedVersion) { - r.markAsDone(obj) + status.MarkReady(r.EventRecorder, obj, "Reconciliation success") return ctrl.Result{RequeueAfter: obj.GetRequeueAfter()}, nil } @@ -281,13 +278,8 @@ func (r *ComponentSubscriptionReconciler) reconcile(ctx context.Context, obj *v1 // Update the replicated version to the latest version obj.Status.LastAppliedVersion = latestSourceComponentVersion.Original() - r.markAsDone(obj) + status.MarkReady(r.EventRecorder, obj, "Reconciliation success") // Always requeue to constantly check for new versions. return ctrl.Result{RequeueAfter: obj.GetRequeueAfter()}, nil } - -func (r *ComponentSubscriptionReconciler) markAsDone(obj *v1alpha1.ComponentSubscription) { - conditions.MarkTrue(obj, meta.ReadyCondition, meta.SucceededReason, "Reconciliation success") - event.New(r.EventRecorder, obj, eventv1.EventSeverityInfo, "Reconciliation success", nil) -} diff --git a/docs/release_notes/v0.10.0.md b/docs/release_notes/v0.10.0.md new file mode 100644 index 0000000..43dee9d --- /dev/null +++ b/docs/release_notes/v0.10.0.md @@ -0,0 +1,6 @@ +# Release 0.10.0 + +- integrate proposals from Soule (#85) +- fix: removing reconciliation status #82 +- fix: add missing role (#81) +- Create dependabot.yml (#78) diff --git a/go.mod b/go.mod index 341fd34..917425d 100644 --- a/go.mod +++ b/go.mod @@ -27,12 +27,11 @@ require ( github.com/Masterminds/semver v1.5.0 github.com/Masterminds/semver/v3 v3.2.1 github.com/distribution/distribution/v3 v3.0.0-20230327091844-0c958010ace2 - github.com/fluxcd/pkg/apis/event v0.5.2 github.com/fluxcd/pkg/apis/meta v1.1.2 github.com/fluxcd/pkg/runtime v0.35.0 github.com/go-logr/logr v1.2.4 github.com/open-component-model/ocm v0.4.0 - github.com/open-component-model/ocm-controller v0.16.0 + github.com/open-component-model/ocm-controller v0.16.1 github.com/stretchr/testify v1.8.4 k8s.io/api v0.28.1 k8s.io/apimachinery v0.28.1 @@ -127,6 +126,7 @@ require ( github.com/evanphx/json-patch/v5 v5.6.0 // indirect github.com/fluxcd/helm-controller/api v0.36.0 // indirect github.com/fluxcd/kustomize-controller/api v1.0.0-rc.1 // indirect + github.com/fluxcd/pkg/apis/event v0.5.2 // indirect github.com/fluxcd/pkg/apis/kustomize v1.1.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/fvbommel/sortorder v1.1.0 // indirect diff --git a/go.sum b/go.sum index 4eb702b..120ed2d 100644 --- a/go.sum +++ b/go.sum @@ -1178,8 +1178,8 @@ github.com/onsi/gomega v1.27.10 h1:naR28SdDFlqrG6kScpT8VWpu1xWY5nJRCF3XaYyBjhI= github.com/onsi/gomega v1.27.10/go.mod h1:RsS8tutOdbdgzbPtzzATp12yT7kM5I5aElG3evPbQ0M= github.com/open-component-model/ocm v0.4.0 h1:S+rPJGoDnSvxhBn3QS2HXURxugTjCM4XWEJLZSaH6Ek= github.com/open-component-model/ocm v0.4.0/go.mod h1:7RAqaUMmA4BlwW5ZEUBm8amWIb1TL9FhNigNXQ6wiu0= -github.com/open-component-model/ocm-controller v0.16.0 h1:yhZI95pg/DVs59RwOl41xcePaEVQMZDx0P5CKhhebqc= -github.com/open-component-model/ocm-controller v0.16.0/go.mod h1:lYax3VEjWAZ7qEr90opJQl+qm/gO3wIeoz1WSEdje2c= +github.com/open-component-model/ocm-controller v0.16.1 h1:Vr04cTivp/kBYktTwDMG4FgmpIS+DdgxX1QnBdBp/hA= +github.com/open-component-model/ocm-controller v0.16.1/go.mod h1:lYax3VEjWAZ7qEr90opJQl+qm/gO3wIeoz1WSEdje2c= github.com/opencontainers/go-digest v0.0.0-20170106003457-a6d0ee40d420/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v0.0.0-20180430190053-c9281466c8b2/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= github.com/opencontainers/go-digest v1.0.0-rc1/go.mod h1:cMLVZDEM3+U2I4VmLI6N8jQYUd2OVphdqWwCJHrFt2s= diff --git a/pkg/version/release.go b/pkg/version/release.go index 84c18dd..c4dddec 100644 --- a/pkg/version/release.go +++ b/pkg/version/release.go @@ -5,7 +5,7 @@ package version // ReleaseVersion is the version number in semver format "vX.Y.Z", prefixed with "v". -var ReleaseVersion = "v0.9.2" +var ReleaseVersion = "v0.10.0" // ReleaseCandidate is the release candidate ID in format "rc.X", which will be appended to the release version. var ReleaseCandidate = "rc.1"