mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Merge pull request #12690 from michalbiesek/feat-go-bump
Update Go version to 1.21
This commit is contained in:
commit
5d22d422ab
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
|
@ -11,7 +11,7 @@ jobs:
|
||||||
# Whenever the Go version is updated here, .promu.yml
|
# Whenever the Go version is updated here, .promu.yml
|
||||||
# should also be updated.
|
# should also be updated.
|
||||||
container:
|
container:
|
||||||
image: quay.io/prometheus/golang-builder:1.20-base
|
image: quay.io/prometheus/golang-builder:1.21-base
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: prometheus/promci@v0.1.0
|
- uses: prometheus/promci@v0.1.0
|
||||||
|
@ -32,7 +32,7 @@ jobs:
|
||||||
# Whenever the Go version is updated here, .promu.yml
|
# Whenever the Go version is updated here, .promu.yml
|
||||||
# should also be updated.
|
# should also be updated.
|
||||||
container:
|
container:
|
||||||
image: quay.io/prometheus/golang-builder:1.20-base
|
image: quay.io/prometheus/golang-builder:1.21-base
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
@ -55,7 +55,7 @@ jobs:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v4
|
- uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '>=1.20 <1.21'
|
go-version: '>=1.21 <1.22'
|
||||||
- run: |
|
- run: |
|
||||||
$TestTargets = go list ./... | Where-Object { $_ -NotMatch "(github.com/prometheus/prometheus/discovery.*|github.com/prometheus/prometheus/config|github.com/prometheus/prometheus/web)"}
|
$TestTargets = go list ./... | Where-Object { $_ -NotMatch "(github.com/prometheus/prometheus/discovery.*|github.com/prometheus/prometheus/config|github.com/prometheus/prometheus/web)"}
|
||||||
go test $TestTargets -vet=off -v
|
go test $TestTargets -vet=off -v
|
||||||
|
@ -66,7 +66,7 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
# The go verson in this image should be N-1 wrt test_go.
|
# The go verson in this image should be N-1 wrt test_go.
|
||||||
container:
|
container:
|
||||||
image: quay.io/prometheus/golang-builder:1.19-base
|
image: quay.io/prometheus/golang-builder:1.20-base
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- run: make build
|
- run: make build
|
||||||
|
@ -79,7 +79,7 @@ jobs:
|
||||||
# Whenever the Go version is updated here, .promu.yml
|
# Whenever the Go version is updated here, .promu.yml
|
||||||
# should also be updated.
|
# should also be updated.
|
||||||
container:
|
container:
|
||||||
image: quay.io/prometheus/golang-builder:1.19-base
|
image: quay.io/prometheus/golang-builder:1.20-base
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- run: go install ./cmd/promtool/.
|
- run: go install ./cmd/promtool/.
|
||||||
|
|
2
.github/workflows/codeql-analysis.yml
vendored
2
.github/workflows/codeql-analysis.yml
vendored
|
@ -27,7 +27,7 @@ jobs:
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
- uses: actions/setup-go@v4
|
- uses: actions/setup-go@v4
|
||||||
with:
|
with:
|
||||||
go-version: '>=1.20 <1.21'
|
go-version: '>=1.21 <1.22'
|
||||||
|
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v2
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
go:
|
go:
|
||||||
# Whenever the Go version is updated here,
|
# Whenever the Go version is updated here,
|
||||||
# .circle/config.yml should also be updated.
|
# .circle/config.yml should also be updated.
|
||||||
version: 1.20
|
version: 1.21
|
||||||
repository:
|
repository:
|
||||||
path: github.com/prometheus/prometheus
|
path: github.com/prometheus/prometheus
|
||||||
build:
|
build:
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,6 +1,6 @@
|
||||||
module github.com/prometheus/prometheus
|
module github.com/prometheus/prometheus
|
||||||
|
|
||||||
go 1.19
|
go 1.20
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible
|
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible
|
||||||
|
|
|
@ -16,11 +16,12 @@ package wlog
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/rand"
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
"hash/crc32"
|
"hash/crc32"
|
||||||
"io"
|
"io"
|
||||||
"math/rand"
|
"math/big"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
@ -252,8 +253,11 @@ func generateRandomEntries(w *WL, records chan []byte) error {
|
||||||
default:
|
default:
|
||||||
sz = pageSize * 8
|
sz = pageSize * 8
|
||||||
}
|
}
|
||||||
|
n, err := rand.Int(rand.Reader, big.NewInt(sz))
|
||||||
rec := make([]byte, rand.Int63n(sz))
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
rec := make([]byte, n.Int64())
|
||||||
if _, err := rand.Read(rec); err != nil {
|
if _, err := rand.Read(rec); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -262,7 +266,11 @@ func generateRandomEntries(w *WL, records chan []byte) error {
|
||||||
|
|
||||||
// Randomly batch up records.
|
// Randomly batch up records.
|
||||||
recs = append(recs, rec)
|
recs = append(recs, rec)
|
||||||
if rand.Intn(4) < 3 {
|
n, err = rand.Int(rand.Reader, big.NewInt(int64(4)))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
if int(n.Int64()) < 3 {
|
||||||
if err := w.Log(recs...); err != nil {
|
if err := w.Log(recs...); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,9 +16,9 @@ package wlog
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"crypto/rand"
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"math/rand"
|
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
Loading…
Reference in a new issue