1
0
Fork 0
mirror of https://github.com/prometheus-operator/prometheus-operator.git synced 2025-04-21 03:38:43 +00:00

Merge branch 'prometheus-operator:main' into main

This commit is contained in:
DHARMIK GANGANI 2024-12-04 11:12:52 -04:00 committed by GitHub
commit 27d16a6501
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 27 additions and 28 deletions
.github/workflows
Documentation
cmd/po-docgen
go.modgo.sum
pkg/operator
test/framework

View file

@ -66,7 +66,7 @@ jobs:
- name: Run tests
env:
E2E_DIAGNOSTIC_DIRECTORY: ${{ env.E2E_DIAGNOSTIC_DIRECTORY }}
TEST_EXPERIMENTAL_PROMETHEUS: "true"
TEST_PROMETHEUS_V2: "true"
run: |
make ${{ matrix.target }}

View file

@ -53,10 +53,6 @@ Prometheus Operator supports all Prometheus versions >= v2.0.0. The operator's e
* v2.54.1
* v2.55.0
* v2.55.1
* v3.0.0-beta.0
* v3.0.0-beta.1
* v3.0.0-rc.0
* v3.0.0-rc.1
* v3.0.0
* v3.0.1
```
@ -64,7 +60,7 @@ Prometheus Operator supports all Prometheus versions >= v2.0.0. The operator's e
The end-to-end tests are mostly tested against
```$ mdox-exec="go run ./cmd/po-docgen/. compatibility defaultPrometheusVersion"
* v2.55.1
* v3.0.1
```
## Alertmanager
@ -84,5 +80,5 @@ The Prometheus Operator is compatible with Thanos v0.10 and above.
The end-to-end tests are mostly tested against
```$ mdox-exec="go run ./cmd/po-docgen/. compatibility defaultThanosVersion"
* v0.37.0
* v0.37.1
```

View file

@ -27,7 +27,7 @@ type compatibilityMatrix struct {
func getCompatibilityMatrix() compatibilityMatrix {
return compatibilityMatrix{
PrometheusVersions: append(operator.PrometheusCompatibilityMatrix, operator.PrometheusExperimentalVersions...),
PrometheusVersions: operator.PrometheusCompatibilityMatrix,
DefaultPrometheus: operator.DefaultPrometheusVersion,
DefaultAlertmanager: operator.DefaultAlertmanagerVersion,
DefaultThanos: operator.DefaultThanosVersion,

2
go.mod
View file

@ -29,7 +29,7 @@ require (
github.com/prometheus/exporter-toolkit v0.13.1
github.com/prometheus/prometheus v0.300.1
github.com/stretchr/testify v1.10.0
github.com/thanos-io/thanos v0.37.0
github.com/thanos-io/thanos v0.37.1
go.uber.org/automaxprocs v1.6.0
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0
golang.org/x/net v0.31.0

4
go.sum
View file

@ -419,8 +419,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/thanos-io/thanos v0.37.0 h1:RCO2pL3S1sU6Wd3ITviWSzouFg8VVzpz92eCJOUEnow=
github.com/thanos-io/thanos v0.37.0/go.mod h1:bkdS9wnItzpNofJjjp2R7Y5Xt5UeA688dLKcjmf7MaA=
github.com/thanos-io/thanos v0.37.1 h1:PuTMql3S/i5UWlBT0WbCDwwL6Kc6Jf7DLHt2rdj4ivY=
github.com/thanos-io/thanos v0.37.1/go.mod h1:5Ni7Uc1Bc8UCGOYmZ/2f/LVvDkZKNDdqDJZqjDFG+rI=
github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM=
github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg=
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=

View file

@ -14,7 +14,11 @@
package operator
import "github.com/prometheus/common/version"
import (
"strings"
"github.com/prometheus/common/version"
)
const (
// DefaultAlertmanagerVersion is a default image tag for the prometheus alertmanager.
@ -25,7 +29,7 @@ const (
DefaultAlertmanagerImage = DefaultAlertmanagerBaseImage + ":" + DefaultAlertmanagerVersion
// DefaultThanosVersion is a default image tag for the Thanos long-term prometheus storage collector.
DefaultThanosVersion = "v0.37.0"
DefaultThanosVersion = "v0.37.1"
// DefaultThanosBaseImage is a base container registry address for the Thanos long-term prometheus
// storage collector.
DefaultThanosBaseImage = "quay.io/thanos/thanos"
@ -36,8 +40,8 @@ const (
var (
// DefaultPrometheusVersion is a default image tag for the prometheus.
DefaultPrometheusVersion = PrometheusCompatibilityMatrix[len(PrometheusCompatibilityMatrix)-1]
// DefaultPrometheusExperimentalVersion is a default image tag for the prometheus experimental version (like Prometheus 3 beta).
DefaultPrometheusExperimentalVersion = PrometheusExperimentalVersions[len(PrometheusExperimentalVersions)-1]
// DefaultPrometheusV2 is latest version of Prometheus v2.
DefaultPrometheusV2 = getLatestPrometheusV2()
// DefaultPrometheusBaseImage is a base container registry address for the prometheus.
DefaultPrometheusBaseImage = "quay.io/prometheus/prometheus"
// DefaultPrometheusImage is a default image pulling address for the prometheus.
@ -75,17 +79,17 @@ var (
"v2.54.1",
"v2.55.0",
"v2.55.1",
}
// Note: Issues in this version won't be supported by operator till its stable
// This is only added for users to try the unstable versions.
PrometheusExperimentalVersions = []string{
"v3.0.0-beta.0",
"v3.0.0-beta.1",
"v3.0.0-rc.0",
"v3.0.0-rc.1",
// TODO: To be moved to default latest version once we tested fully.
"v3.0.0",
"v3.0.1",
}
)
func getLatestPrometheusV2() string {
for i, version := range PrometheusCompatibilityMatrix {
// Since last v2 version would be one just before the first v3 version
if strings.HasPrefix(version, "v3") {
return PrometheusCompatibilityMatrix[i-1]
}
}
panic("failed to find a v2.x entry in the compatibility matrix")
}

View file

@ -179,9 +179,8 @@ func (f *Framework) CreateCertificateResources(namespace, certsDir string, prwtc
func (f *Framework) MakeBasicPrometheus(ns, name, group string, replicas int32) *monitoringv1.Prometheus {
promVersion := operator.DefaultPrometheusVersion
// Because Prometheus 3 is supported from version 0.77.0 only
if os.Getenv("TEST_EXPERIMENTAL_PROMETHEUS") == "true" && f.operatorVersion.Minor >= 77 {
promVersion = operator.DefaultPrometheusExperimentalVersion
if os.Getenv("TEST_PROMETHEUS_V2") == "true" {
promVersion = operator.DefaultPrometheusV2
}
return &monitoringv1.Prometheus{
ObjectMeta: metav1.ObjectMeta{