Skip to content

Commit

Permalink
fix: initiliase default statestore properly
Browse files Browse the repository at this point in the history
  • Loading branch information
mdelapenya committed Sep 25, 2023
1 parent 07d541a commit 03f5ac9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 0 additions & 2 deletions modules/dapr/dapr.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,6 @@ func RunContainer(ctx context.Context, opts ...testcontainers.ContainerCustomize
Started: true,
}

opts = append(opts, WithComponents(NewComponent("statestore", "state.in-memory", map[string]string{})))

settings := defaultOptions()
for _, opt := range opts {
if apply, ok := opt.(Option); ok {
Expand Down
9 changes: 7 additions & 2 deletions modules/dapr/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ type options struct {
NetworkName string
}

// defaultOptions returns the default options for the Dapr container, including an in-memory state store.
func defaultOptions() options {
inMemoryStore := NewComponent("statestore", "state.in-memory", map[string]string{})

return options{
AppName: defaultDaprAppName,
Components: map[string]Component{},
AppName: defaultDaprAppName,
Components: map[string]Component{
inMemoryStore.Key(): inMemoryStore,
},
ComponentsPath: defaultComponentsPath,
NetworkName: defaultDaprNetworkName,
}
Expand Down

0 comments on commit 03f5ac9

Please sign in to comment.