Skip to content

Commit

Permalink
fix: removing reconciliation status (#77)
Browse files Browse the repository at this point in the history
* fix: removing reconciliation status

* using the right version

* adding release docs
  • Loading branch information
Skarlso authored Nov 17, 2023
1 parent 208ae21 commit 19baa80
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 31 deletions.
5 changes: 1 addition & 4 deletions controllers/productdeployment_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@ import (
"fmt"
"time"

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"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -191,8 +189,7 @@ func (r *ProductDeploymentReconciler) reconcile(ctx context.Context, obj *v1alph
}

logger.Info("all pipelines handled successfully")
conditions.MarkTrue(obj, meta.ReadyCondition, meta.SucceededReason, "Reconciliation success")
event.New(r.EventRecorder, obj, eventv1.EventSeverityInfo, "Reconciliation success", nil)
status.MarkReady(r.EventRecorder, obj, "Reconciliation success")

// TODO: do something with failed and successful pipelines
return ctrl.Result{}, nil
Expand Down
8 changes: 2 additions & 6 deletions controllers/productdeploymentgenerator_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ 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"
Expand All @@ -27,7 +26,6 @@ import (
goyamlast "github.com/goccy/go-yaml/ast"
goyamlparser "github.com/goccy/go-yaml/parser"
projectv1 "github.com/open-component-model/mpas-project-controller/api/v1alpha1"
"github.com/open-component-model/ocm-controller/pkg/event"
"github.com/open-component-model/ocm-controller/pkg/status"
markdown "github.com/teekennedy/goldmark-markdown"
"github.com/yuin/goldmark"
Expand Down Expand Up @@ -205,8 +203,7 @@ func (r *ProductDeploymentGeneratorReconciler) reconcile(ctx context.Context, ob
}

if lastReconciledSubscription.Equal(lastReconciledGeneratorVersion) || lastReconciledSubscription.LessThan(lastReconciledGeneratorVersion) {
conditions.MarkTrue(obj, meta.ReadyCondition, meta.SucceededReason, "Reconciliation success")
event.New(r.EventRecorder, obj, eventv1.EventSeverityInfo, "Reconciliation success", nil)
status.MarkReady(r.EventRecorder, obj, "Reconciliation success")

return ctrl.Result{}, nil
}
Expand Down Expand Up @@ -416,8 +413,7 @@ func (r *ProductDeploymentGeneratorReconciler) reconcile(ctx context.Context, ob
rreconcile.ProgressiveStatus(false, obj, meta.ProgressingReason, "components applied and generated")

obj.Status.LastReconciledVersion = component.Version
conditions.MarkTrue(obj, meta.ReadyCondition, meta.SucceededReason, "Applied version: %s", component.Version)
event.New(r.EventRecorder, obj, eventv1.EventSeverityInfo, "Reconciliation success", nil)
status.MarkReady(r.EventRecorder, obj, "Applied version: %s", component.Version)

return ctrl.Result{}, nil
}
Expand Down
6 changes: 1 addition & 5 deletions controllers/productdeploymentpipeline_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ import (
"fmt"
"time"

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"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -151,8 +148,7 @@ func (r *ProductDeploymentPipelineReconciler) Reconcile(ctx context.Context, req
Namespace: obj.Namespace,
}

conditions.MarkTrue(obj, meta.ReadyCondition, meta.SucceededReason, "Reconciliation success")
event.New(r.EventRecorder, obj, eventv1.EventSeverityInfo, "Reconciliation success", nil)
status.MarkReady(r.EventRecorder, obj, "Reconciliation success")

return ctrl.Result{}, nil
}
Expand Down
1 change: 1 addition & 0 deletions controllers/productdeploymentpipeline_scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ func (r *ProductDeploymentPipelineScheduler) Reconcile(ctx context.Context, req

conditions.MarkTrue(obj, mpasv1alpha1.DeployedCondition, meta.SucceededReason, "Successfully deployed")
event.New(r.EventRecorder, obj, eventv1.EventSeverityInfo, "Reconciliation success", nil)
conditions.Delete(obj, meta.ReconcilingCondition)

return ctrl.Result{}, nil
}
7 changes: 7 additions & 0 deletions docs/release_notes/v0.8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Release 0.8.0
[
- build(deps): bump the ci group with 2 updates (#80)
- build(deps): bump golang.org/x/oauth2 from 0.11.0 to 0.14.0 (#82)
- fix issue Target SA is required where it should be optional (#79)
- fix: removing reconciliation status (#77)
- Create dependabot.yml (#76)
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ require (
github.com/fluxcd/source-controller/api v1.1.0
github.com/goccy/go-yaml v1.9.5
github.com/google/go-github/v52 v52.0.0
github.com/open-component-model/git-controller v0.7.0
github.com/open-component-model/git-controller v0.10.0
github.com/open-component-model/mpas-project-controller v0.2.0
github.com/open-component-model/ocm v0.4.0
github.com/open-component-model/ocm-controller v0.16.0
github.com/open-component-model/replication-controller v0.6.1
github.com/open-component-model/ocm-controller v0.16.1
github.com/open-component-model/replication-controller v0.9.0
github.com/open-policy-agent/opa v0.56.0
github.com/phayes/freeport v0.0.0-20220201140144-74d24b5ae9f5
github.com/stretchr/testify v1.8.4
Expand Down
24 changes: 12 additions & 12 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ github.com/Azure/azure-sdk-for-go v16.2.1+incompatible/go.mod h1:9XXNKU+eRnpl9mo
github.com/Azure/azure-sdk-for-go v46.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible h1:fcYLmCpyNYRnvJbPerq7U0hS+6+I79yEDJBqVNcqUzU=
github.com/Azure/azure-sdk-for-go v68.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1 h1:SEy2xmstIphdPwNBUi7uhvjyjhVKISfwjfOJmuy7kg4=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.6.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0 h1:vcYCAze6p19qBW7MhZybIsqD8sMV8js0NyQM8JDnVtg=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.0/go.mod h1:OQeznEEkTZ9OrhHJoDD8ZDq51FHgXjqtP9z6bEwBq9U=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1 h1:/iHxaJhsFr0+xVFfbMr5vxz848jyiWuIEDhYq3y5odY=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1 h1:LNHhpdK7hzUcx/k1LIcuh5k7k1LGIWLQfCjaneSj7Fc=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.3.1/go.mod h1:uE9zaUfEQT/nbQjVi2IblCG9iaLtZsuYZ8ne+PuQ02M=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY=
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0/go.mod h1:okt5dMMTOFjX/aovMlrjvvXoPMBVSPzk9185BT0+eZM=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v0.12.0 h1:4Kynh6Hn2ekyIsBgNQJb3dn1+/MyvzfUJebti2emB/A=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v0.12.0/go.mod h1:Q28U+75mpCaSCDowNEmhIo/rmgdkqmkmzI7N6TGR4UY=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1 h1:MyVTgWR8qd/Jw1Le0NZebGBUCLbtak3bJ3z1OlqZBpw=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/azkeys v1.0.1/go.mod h1:GpPjLhVR9dnUoJMyHWSPy71xY9/lcmpzIPZXmF0FCVY=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0 h1:T028gtTPiYt/RMUfs8nVsAL7FDQrfLlrm/NnRG/zcC4=
github.com/Azure/azure-sdk-for-go/sdk/security/keyvault/internal v0.8.0/go.mod h1:cw4zVQgBby0Z5f2v0itn6se2dDP17nTjbZFXW5uPyHA=
github.com/Azure/go-ansiterm v0.0.0-20170929234023-d6e3b3328b78/go.mod h1:LmzpDX56iTiv29bbRTIsUNlaFfuhWRQBWjQdVyAevI8=
Expand Down Expand Up @@ -1246,16 +1246,16 @@ github.com/onsi/gomega v1.27.3/go.mod h1:5vG284IBtfDAmDyrK+eGyZmUgUlmi+Wngqo557c
github.com/onsi/gomega v1.27.4/go.mod h1:riYq/GJKh8hhoM01HN6Vmuy93AarCXCBGpvFDK3q3fQ=
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/git-controller v0.7.0 h1:8Pn8RrmTN9Xge5fVHLhSzC0dFHqKSF6hW06/pupmRBI=
github.com/open-component-model/git-controller v0.7.0/go.mod h1:/ZuDL3xHC23zgxOVMn38y8WNKlithrphzbfNxgqbnlw=
github.com/open-component-model/git-controller v0.10.0 h1:wUMfEpo64VZGpV9zstv4QkzuW/8IACNx5oo3u38DkKE=
github.com/open-component-model/git-controller v0.10.0/go.mod h1:GvxPkggogs4gNCBsdRNq44hZD4vlg8e6OzlJMpfa5uo=
github.com/open-component-model/mpas-project-controller v0.2.0 h1:4l8isUi2A+NBT7UOO4KTXE3G0eOkAT5bR8pqdzc/Xww=
github.com/open-component-model/mpas-project-controller v0.2.0/go.mod h1:zBwWb2/5+BRseF8AL7rjCZajXF69ExqflNcqwEXSSAM=
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/replication-controller v0.6.1 h1:uRJ6ddVMkg8bIzKxaytIeP6TeWEyGmiEEdGE5odKqEc=
github.com/open-component-model/replication-controller v0.6.1/go.mod h1:owHvAVQbfxdXwCIfoCuEYGG1bXlAH1FWsNWddv1hEdU=
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/open-component-model/replication-controller v0.9.0 h1:nLLofeH+STCvXj2Fc7Wq96Xlw9l0xZRENcJWqS+Cf0g=
github.com/open-component-model/replication-controller v0.9.0/go.mod h1:u2/MrLz1d0NiGP8qulMCpKDU9lPiGzz4cE2HXMni60M=
github.com/open-policy-agent/opa v0.56.0 h1:FUSb6MyckjuffOMshEG8P+HGnckxkJ8ENZJHEzAddhk=
github.com/open-policy-agent/opa v0.56.0/go.mod h1:un01L10fkolr00KJMDSqGb2FXCjVyVQOybLtHOfSEfY=
github.com/opencontainers/go-digest v1.0.1-0.20220411205349-bde1400a84be h1:f2PlhC9pm5sqpBZFvnAoKj+KzXRzbjFMA+TqXfJdgho=
Expand Down
2 changes: 1 addition & 1 deletion pkg/version/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
package version

// ReleaseVersion is the version number in semver format "vX.Y.Z", prefixed with "v".
var ReleaseVersion = "v0.7.0"
var ReleaseVersion = "v0.8.0"

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

0 comments on commit 19baa80

Please sign in to comment.