mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-11-26 10:07:34 -05:00
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:
1 file changed
+6
-2
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user