Synchronize common files from prometheus/prometheus (#3191)

* Update common Prometheus files

* cluster: fix formatting

Signed-off-by: prombot <prometheus-team@googlegroups.com>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
PrometheusBot 2022-12-23 10:59:32 +01:00 committed by GitHub
parent c2b2defe48
commit 87ad8437fc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View File

@ -61,7 +61,7 @@ PROMU_URL := https://github.com/prometheus/promu/releases/download/v$(PROMU_
SKIP_GOLANGCI_LINT := SKIP_GOLANGCI_LINT :=
GOLANGCI_LINT := GOLANGCI_LINT :=
GOLANGCI_LINT_OPTS ?= GOLANGCI_LINT_OPTS ?=
GOLANGCI_LINT_VERSION ?= v1.49.0 GOLANGCI_LINT_VERSION ?= v1.50.1
# golangci-lint only supports linux, darwin and windows platforms on i386/amd64. # golangci-lint only supports linux, darwin and windows platforms on i386/amd64.
# windows isn't included here because of the path separator being different. # windows isn't included here because of the path separator being different.
ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin)) ifeq ($(GOHOSTOS),$(filter $(GOHOSTOS),linux darwin))

View File

@ -23,8 +23,10 @@ import (
type getIPFunc func() (string, error) type getIPFunc func() (string, error)
// These are overridden in unit tests to mock the sockaddr functions. // These are overridden in unit tests to mock the sockaddr functions.
var getPrivateAddress getIPFunc = sockaddr.GetPrivateIP var (
var getPublicAddress getIPFunc = sockaddr.GetPublicIP getPrivateAddress getIPFunc = sockaddr.GetPrivateIP
getPublicAddress getIPFunc = sockaddr.GetPublicIP
)
// calculateAdvertiseAddress attempts to clone logic from deep within memberlist // calculateAdvertiseAddress attempts to clone logic from deep within memberlist
// (NetTransport.FinalAdvertiseAddr) in order to surface its conclusions to the // (NetTransport.FinalAdvertiseAddr) in order to surface its conclusions to the