Skip to content

Commit

Permalink
Merge pull request #201 from formancehq/feat/ledgeupgrade
Browse files Browse the repository at this point in the history
feat: use a migration job for ledger 2.2 too...
  • Loading branch information
gfyrag authored Dec 20, 2024
2 parents 3dc1dd8 + 14dd0bd commit 5ca2214
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
1 change: 0 additions & 1 deletion internal/resources/ledgers/deployments.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ func installLedgerStateless(ctx core.Context, stack *v1beta1.Stack,
}
container.Env = append(container.Env,
core.Env("BIND", ":8080"),
core.Env("AUTO_UPGRADE", "true"),
)

experimentalFeatures, err := settings.GetBoolOrFalse(ctx, stack.Name, "ledger", "experimental-features")
Expand Down
6 changes: 1 addition & 5 deletions internal/resources/ledgers/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,9 @@ func Reconcile(ctx Context, stack *v1beta1.Stack, ledger *v1beta1.Ledger, versio
}

isV2 := false
isV2_2 := false
if !semver.IsValid(version) || semver.Compare(version, "v2.0.0-alpha") > 0 {
isV2 = true
}
if !semver.IsValid(version) || semver.Compare(version, "v2.2.0-alpha") > 0 {
isV2_2 = true
}

if err := benthosstreams.LoadFromFileSystem(ctx, benthos.Streams, ledger, "streams/ledger", "ingestion"); err != nil {
return err
Expand Down Expand Up @@ -96,7 +92,7 @@ func Reconcile(ctx Context, stack *v1beta1.Stack, ledger *v1beta1.Ledger, versio
return NewPendingError().WithMessage("database not ready")
}

if isV2 && !isV2_2 && databases.GetSavedModuleVersion(database) != version {
if isV2 && databases.GetSavedModuleVersion(database) != version {
if err := migrate(ctx, stack, ledger, database, image, version); err != nil {
return err
}
Expand Down

0 comments on commit 5ca2214

Please sign in to comment.