Skip to content

Commit

Permalink
fix(cluster): don't query empty host on client creation
Browse files Browse the repository at this point in the history
Fixes #3849
  • Loading branch information
Michal-Leszczynski authored and karol-kokoszka committed May 16, 2024
1 parent e523e70 commit 15c87ca
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/service/cluster/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,11 @@ func (s *Service) CreateClientNoCache(ctx context.Context, clusterID uuid.UUID)
config.Port = fmt.Sprint(c.Port)
}
config.AuthToken = c.AuthToken
config.Hosts = append([]string{c.Host}, c.KnownHosts...)
config.Hosts = nil
if c.Host != "" {
config.Hosts = []string{c.Host}
}
config.Hosts = append(config.Hosts, c.KnownHosts...)

client, err := scyllaclient.NewClient(config, s.logger.Named("client"))
if err != nil {
Expand Down

0 comments on commit 15c87ca

Please sign in to comment.