Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions internal/beater/beater.go
Original file line number Diff line number Diff line change
Expand Up @@ -966,9 +966,12 @@ func queryClusterUUID(ctx context.Context, esClient *elasticsearch.Client, state
// Running under elastic-agent, the callback linked above is not
// registered until later, meaning we need to check and instantiate the
// registries if they don't exist.
elasticsearchRegistry := stateRegistry.GetRegistry(outputES)
elasticsearchRegistry := stateRegistry.GetOrCreateRegistry(outputES)
if elasticsearchRegistry == nil {
elasticsearchRegistry = stateRegistry.NewRegistry(outputES)
// This can only happen if "outputs.elasticsearch" was already created as
// a non-registry (scalar) value, but in that unlikely chance, let's still
// report a comprehensible error.
return fmt.Errorf("couldn't create registry: %v", outputES)
}

var (
Expand Down
Loading