Skip to content

Commit

Permalink
refactor: create separate reconciler for control flow Stage (#2848)
Browse files Browse the repository at this point in the history
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
  • Loading branch information
hiddeco authored Oct 28, 2024
1 parent a25dc52 commit b2be266
Show file tree
Hide file tree
Showing 14 changed files with 4,938 additions and 872 deletions.
11 changes: 11 additions & 0 deletions cmd/controlplane/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"github.com/akuity/kargo/internal/credentials"
credsdb "github.com/akuity/kargo/internal/credentials/kubernetes"
"github.com/akuity/kargo/internal/directives"
"github.com/akuity/kargo/internal/indexer"
"github.com/akuity/kargo/internal/logging"
"github.com/akuity/kargo/internal/os"
"github.com/akuity/kargo/internal/types"
Expand Down Expand Up @@ -291,6 +292,7 @@ func (o *controllerOptions) setupReconcilers(
if argocdMgr != nil {
argoCDClient = argocdMgr.GetClient()
}
sharedIndexer := indexer.NewSharedFieldIndexer(kargoMgr.GetFieldIndexer())

directivesEngine := directives.NewSimpleEngine(credentialsDB, kargoMgr.GetClient(), argoCDClient)

Expand All @@ -310,10 +312,19 @@ func (o *controllerOptions) setupReconcilers(
argocdMgr,
directivesEngine,
stagesReconcilerCfg,
sharedIndexer,
); err != nil {
return fmt.Errorf("error setting up Stages reconciler: %w", err)
}

if err := stages.NewControlFlowStageReconciler(stagesReconcilerCfg).SetupWithManager(
ctx,
kargoMgr,
sharedIndexer,
); err != nil {
return fmt.Errorf("error setting up control flow Stages reconciler: %w", err)
}

if err := warehouses.SetupReconcilerWithManager(
kargoMgr,
credentialsDB,
Expand Down
Loading

0 comments on commit b2be266

Please sign in to comment.