diff --git a/go.mod b/go.mod index 726a671d9..b53b73548 100644 --- a/go.mod +++ b/go.mod @@ -14,7 +14,7 @@ require ( github.com/onsi/ginkgo/v2 v2.27.2 github.com/onsi/gomega v1.38.2 github.com/openshift/api v0.0.0-20250707164913-2cd5821c9080 - github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.86.2 + github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.87.0 github.com/prometheus/common v0.67.4 github.com/sirupsen/logrus v1.9.3 github.com/stretchr/testify v1.11.1 diff --git a/go.sum b/go.sum index 81cfe4db4..41febd120 100644 --- a/go.sum +++ b/go.sum @@ -140,8 +140,8 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.86.2 h1:VRXUgbGmpmjZgFYiUnTwlC+JjfCUs5KKFsorJhI1ZKQ= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.86.2/go.mod h1:nPk0OteXBkbT0CRCa2oZQL1jRLW6RJ2fuIijHypeJdk= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.87.0 h1:QK37j5ZUtBwbyZkF4BBAs3bQQ1gYKG8e+g1BdNZBr/M= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.87.0/go.mod h1:WHiLZmOWVop/MoYvRD58LfnPeyE+dcITby/jQjg83Hw= github.com/prometheus/client_golang v1.23.2 h1:Je96obch5RDVy3FDMndoUsjAhG5Edi49h0RJWRi/o0o= github.com/prometheus/client_golang v1.23.2/go.mod h1:Tb1a6LWHB3/SPIzCoaDXI4I8UHKeFTEQ1YCr+0Gyqmg= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/podmonitor_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/podmonitor_types.go index 58783ae82..8f439fd11 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/podmonitor_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/podmonitor_types.go @@ -218,11 +218,30 @@ func (l *PodMonitorList) DeepCopyObject() runtime.Object { type PodMetricsEndpoint struct { // port defines the `Pod` port name which exposes the endpoint. // + // If the pod doesn't expose a port with the same name, it will result + // in no targets being discovered. + // + // If a `Pod` has multiple `Port`s with the same name (which is not + // recommended), one target instance per unique port number will be + // generated. + // // It takes precedence over the `portNumber` and `targetPort` fields. // +optional Port *string `json:"port,omitempty"` // portNumber defines the `Pod` port number which exposes the endpoint. + // + // The `Pod` must declare the specified `Port` in its spec or the + // target will be dropped by Prometheus. + // + // This cannot be used to enable scraping of an undeclared port. + // To scrape targets on a port which isn't exposed, you need to use + // relabeling to override the `__address__` label (but beware of + // duplicate targets if the `Pod` has other declared ports). + // + // In practice Prometheus will select targets for which the + // matches the target's __meta_kubernetes_pod_container_port_number. + // // +kubebuilder:validation:Minimum=1 // +kubebuilder:validation:Maximum=65535 // +optional @@ -243,14 +262,8 @@ type PodMetricsEndpoint struct { // scheme defines the HTTP scheme to use for scraping. // - // `http` and `https` are the expected values unless you rewrite the - // `__scheme__` label via relabeling. - // - // If empty, Prometheus uses the default value `http`. - // - // +kubebuilder:validation:Enum=http;https // +optional - Scheme string `json:"scheme,omitempty"` + Scheme *Scheme `json:"scheme,omitempty"` // params define optional HTTP URL parameters. // +optional diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/probe_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/probe_types.go index 0dabfe5e9..34218f4ca 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/probe_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/probe_types.go @@ -257,17 +257,24 @@ type ProbeTargetIngress struct { // ProberSpec contains specification parameters for the Prober used for probing. // +k8s:openapi-gen=true type ProberSpec struct { - // url defines the mandatory URL of the prober. + // url defines the address of the prober. + // + // Unlike what the name indicates, the value should be in the form of + // `address:port` without any scheme which should be specified in the + // `scheme` field. + // + // +kubebuilder:validation:MinLength=1 // +required URL string `json:"url"` - // scheme defines the HTTP scheme to use for scraping. - // `http` and `https` are the expected values unless you rewrite the `__scheme__` label via relabeling. - // If empty, Prometheus uses the default value `http`. - // +kubebuilder:validation:Enum=http;https + + // scheme defines the HTTP scheme to use when scraping the prober. + // // +optional - Scheme string `json:"scheme,omitempty"` + Scheme *Scheme `json:"scheme,omitempty"` + // path to collect metrics from. // Defaults to `/probe`. + // // +kubebuilder:default:="/probe" // +optional Path string `json:"path,omitempty"` diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheus_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheus_types.go index 71427906e..2122906ac 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheus_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheus_types.go @@ -1764,6 +1764,10 @@ type RemoteWriteSpec struct { QueueConfig *QueueConfig `json:"queueConfig,omitempty"` // metadataConfig defines how to send a series metadata to the remote storage. + // + // When the field is empty, **no metadata** is sent. But when the field is + // null, metadata is sent. + // // +optional MetadataConfig *MetadataConfig `json:"metadataConfig,omitempty"` @@ -1863,7 +1867,7 @@ type Sigv4 struct { // roleArn defines the named AWS profile used to authenticate. // +optional RoleArn string `json:"roleArn,omitempty"` - // useFIPSSTSEndpoint defines FIPS mode for AWS STS endpoint. + // useFIPSSTSEndpoint defines the FIPS mode for the AWS STS endpoint. // It requires Prometheus >= v2.54.0. // // +optional @@ -1917,9 +1921,13 @@ type AzureOAuth struct { // ManagedIdentity defines the Azure User-assigned Managed identity. // +k8s:openapi-gen=true type ManagedIdentity struct { - // clientId defines defines the Azure User-assigned Managed identity. - // +required - ClientID string `json:"clientId"` + // clientId defines the Azure User-assigned Managed identity. + // + // For Prometheus >= 3.5.0 and Thanos >= 0.40.0, this field is allowed to be empty to support system-assigned managed identities. + // + // +optional + // +kubebuilder:validation:MinLength:=1 + ClientID *string `json:"clientId"` } // AzureSDK is used to store azure SDK config values. @@ -2166,13 +2174,16 @@ type AlertmanagerEndpoints struct { // +required Port intstr.IntOrString `json:"port"` - // scheme to use when firing alerts. + // scheme defines the HTTP scheme to use when sending alerts. + // // +optional - Scheme string `json:"scheme,omitempty"` + Scheme *Scheme `json:"scheme,omitempty"` // pathPrefix defines the prefix for the HTTP path alerts are pushed to. + // + // +kubebuilder:validation:MinLength=1 // +optional - PathPrefix string `json:"pathPrefix,omitempty"` + PathPrefix *string `json:"pathPrefix,omitempty"` // tlsConfig to use for Alertmanager. // @@ -2277,10 +2288,12 @@ type RulesAlert struct { // +k8s:openapi-gen=true type MetadataConfig struct { // send defines whether metric metadata is sent to the remote storage or not. + // // +optional Send bool `json:"send,omitempty"` // sendInterval defines how frequently metric metadata is sent to the remote storage. + // // +optional SendInterval Duration `json:"sendInterval,omitempty"` diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheusrule_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheusrule_types.go index 1534ee4ba..576f8d389 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheusrule_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/prometheusrule_types.go @@ -58,6 +58,10 @@ func (f *PrometheusRule) DeepCopyObject() runtime.Object { return f.DeepCopy() } +func (f *PrometheusRule) Bindings() []WorkloadBinding { + return f.Status.Bindings +} + // PrometheusRuleSpec contains specification parameters for a Rule. // +k8s:openapi-gen=true type PrometheusRuleSpec struct { diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/types.go index eb110df7e..bddbed14b 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/types.go @@ -565,16 +565,10 @@ type Endpoint struct { // +optional Path string `json:"path,omitempty"` - // scheme defines the HTTP scheme to use for scraping. + // scheme defines the HTTP scheme to use when scraping the metrics. // - // `http` and `https` are the expected values unless you rewrite the - // `__scheme__` label via relabeling. - // - // If empty, Prometheus uses the default value `http`. - // - // +kubebuilder:validation:Enum=http;https // +optional - Scheme string `json:"scheme,omitempty"` + Scheme *Scheme `json:"scheme,omitempty"` // params define optional HTTP URL parameters. // +optional @@ -1125,3 +1119,24 @@ type ConfigResourceCondition struct { // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` } + +// Supported values are `HTTP` and `HTTPS`. You can also rewrite the +// `__scheme__` label via relabeling configuration. +// +// If empty, the value defaults to `HTTP`. +// +// +kubebuilder:validation:Enum=http;https;HTTP;HTTPS +type Scheme string + +func (s *Scheme) String() string { + if s == nil { + return "" + } + + return strings.ToLower(string(*s)) +} + +const ( + SchemeHTTP Scheme = "HTTP" + SchemeHTTPS Scheme = "HTTPS" +) diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go index eb0acd741..03b17df8b 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/zz_generated.deepcopy.go @@ -148,6 +148,16 @@ func (in *AlertmanagerEndpoints) DeepCopyInto(out *AlertmanagerEndpoints) { **out = **in } out.Port = in.Port + if in.Scheme != nil { + in, out := &in.Scheme, &out.Scheme + *out = new(Scheme) + **out = **in + } + if in.PathPrefix != nil { + in, out := &in.PathPrefix, &out.PathPrefix + *out = new(string) + **out = **in + } if in.TLSConfig != nil { in, out := &in.TLSConfig, &out.TLSConfig *out = new(TLSConfig) @@ -672,7 +682,7 @@ func (in *AzureAD) DeepCopyInto(out *AzureAD) { if in.ManagedIdentity != nil { in, out := &in.ManagedIdentity, &out.ManagedIdentity *out = new(ManagedIdentity) - **out = **in + (*in).DeepCopyInto(*out) } if in.OAuth != nil { in, out := &in.OAuth, &out.OAuth @@ -1335,6 +1345,11 @@ func (in *Endpoint) DeepCopyInto(out *Endpoint) { *out = new(intstr.IntOrString) **out = **in } + if in.Scheme != nil { + in, out := &in.Scheme, &out.Scheme + *out = new(Scheme) + **out = **in + } if in.Params != nil { in, out := &in.Params, &out.Params *out = make(map[string][]string, len(*in)) @@ -1742,6 +1757,11 @@ func (in *HostPort) DeepCopy() *HostPort { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ManagedIdentity) DeepCopyInto(out *ManagedIdentity) { *out = *in + if in.ClientID != nil { + in, out := &in.ClientID, &out.ClientID + *out = new(string) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ManagedIdentity. @@ -1999,6 +2019,11 @@ func (in *PodMetricsEndpoint) DeepCopyInto(out *PodMetricsEndpoint) { *out = new(intstr.IntOrString) **out = **in } + if in.Scheme != nil { + in, out := &in.Scheme, &out.Scheme + *out = new(Scheme) + **out = **in + } if in.Params != nil { in, out := &in.Params, &out.Params *out = make(map[string][]string, len(*in)) @@ -2437,6 +2462,11 @@ func (in *ProbeTargets) DeepCopy() *ProbeTargets { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProberSpec) DeepCopyInto(out *ProberSpec) { *out = *in + if in.Scheme != nil { + in, out := &in.Scheme, &out.Scheme + *out = new(Scheme) + **out = **in + } in.ProxyConfig.DeepCopyInto(&out.ProxyConfig) } diff --git a/vendor/modules.txt b/vendor/modules.txt index 570f41083..562cc6805 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -237,7 +237,7 @@ github.com/pkg/errors # github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 ## explicit github.com/pmezard/go-difflib/difflib -# github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.86.2 +# github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.87.0 ## explicit; go 1.24.0 github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1