fix(search): default the index endpoint to the configured gRPC address

--endpoint defaulted to a hardcoded 127.0.0.1:9220, so a search service
moved with SEARCH_GRPC_ADDR could only be reached by passing the flag.
Use the configured address when the flag is not set.
This commit is contained in:
José M. Requena Plens committed 2026-10-04 23:34:06 +02:00
1 parent 3dfae3b984
commit e44bd467f3
1 file changed
+6 -2
+6 -2
View File
@@ -42,6 +42,10 @@ func Index(cfg *config.Config) *cobra.Command {
return fmt.Errorf("concurrency %d exceeds max allowed %d", concurrencyFlag, cfg.ReindexMaxConcurrency)
}
if !cmd.Flags().Changed("endpoint") {
endpointFlag = cfg.GRPC.Addr
}
tlsMode := pool.TLSOff
if !insecureFlag {
mode, err := pool.StringToTLSMode(cfg.GRPCClientTLS.Mode)
@@ -122,8 +126,8 @@ func Index(cfg *config.Config) *cobra.Command {
)
indexCmd.Flags().String(
"endpoint",
"127.0.0.1:9220",
"the address of the search service gRPC endpoint.",
"",
"the address of the search service gRPC endpoint. Defaults to the service's configured gRPC address (SEARCH_GRPC_ADDR).",
)
indexCmd.Flags().Bool(
"insecure",