Skip to content

Commit

Permalink
[release-2.9.x] fix: All lifecycler cfgs ref a valid IPv6 addr and po…
Browse files Browse the repository at this point in the history
…rt combination (#11144)

Backport 6385b19 from #11121

Co-authored-by: Periklis Tsirakidis <[email protected]>
  • Loading branch information
grafanabot and periklis authored Nov 6, 2023
1 parent b9a7151 commit 39fb8ff
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

* [10375](https://github.com/grafana/loki/pull/10375) **trevorwhitney**: Fix ingester query when getting label values by passing matchers

##### Changes

* [11121](https://github.com/grafana/loki/pull/11121) **periklis** Ensure all lifecycler cfgs ref a valid IPv6 addr and port combination

## 2.9.2 (2023-10-16)

### All Changes
Expand Down
5 changes: 3 additions & 2 deletions pkg/distributor/distributor_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package distributor

import (
"flag"
"fmt"
"net"
"os"
"strconv"
"time"

"github.com/go-kit/log"
Expand Down Expand Up @@ -72,7 +73,7 @@ func (cfg *RingConfig) ToBasicLifecyclerConfig(logger log.Logger) (ring.BasicLif

return ring.BasicLifecyclerConfig{
ID: cfg.InstanceID,
Addr: fmt.Sprintf("%s:%d", instanceAddr, instancePort),
Addr: net.JoinHostPort(instanceAddr, strconv.Itoa(instancePort)),
HeartbeatPeriod: cfg.HeartbeatPeriod,
HeartbeatTimeout: cfg.HeartbeatTimeout,
TokensObservePeriod: 0,
Expand Down
4 changes: 3 additions & 1 deletion pkg/ruler/base/ruler_ring.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package base
import (
"flag"
"fmt"
"net"
"os"
"strconv"
"time"

"github.com/go-kit/log"
Expand Down Expand Up @@ -88,7 +90,7 @@ func (cfg *RingConfig) ToLifecyclerConfig(logger log.Logger) (ring.BasicLifecycl

return ring.BasicLifecyclerConfig{
ID: cfg.InstanceID,
Addr: fmt.Sprintf("%s:%d", instanceAddr, instancePort),
Addr: net.JoinHostPort(instanceAddr, strconv.Itoa(instancePort)),
HeartbeatPeriod: cfg.HeartbeatPeriod,
TokensObservePeriod: 0,
NumTokens: cfg.NumTokens,
Expand Down
5 changes: 3 additions & 2 deletions pkg/util/ring_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package util

import (
"flag"
"fmt"
"net"
"os"
"strconv"
"time"

"github.com/go-kit/log"
Expand Down Expand Up @@ -81,7 +82,7 @@ func (cfg *RingConfig) ToLifecyclerConfig(numTokens int, logger log.Logger) (rin

return ring.BasicLifecyclerConfig{
ID: cfg.InstanceID,
Addr: fmt.Sprintf("%s:%d", instanceAddr, instancePort),
Addr: net.JoinHostPort(instanceAddr, strconv.Itoa(instancePort)),
Zone: cfg.InstanceZone,
HeartbeatPeriod: cfg.HeartbeatPeriod,
TokensObservePeriod: 0,
Expand Down

0 comments on commit 39fb8ff

Please sign in to comment.