From 9db9f7c3047ecf934e6aae1df3fdb0728357eabb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Jul 2025 08:34:46 +0000 Subject: [PATCH] Bump github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring Bumps [github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring](https://github.com/prometheus-operator/prometheus-operator) from 0.83.0 to 0.84.0. - [Release notes](https://github.com/prometheus-operator/prometheus-operator/releases) - [Changelog](https://github.com/prometheus-operator/prometheus-operator/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus-operator/prometheus-operator/compare/v0.83.0...v0.84.0) --- updated-dependencies: - dependency-name: github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring dependency-version: 0.84.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- go.mod | 6 +- go.sum | 12 +- .../apis/monitoring/v1/alertmanager_types.go | 115 +++++++- .../apis/monitoring/v1/podmonitor_types.go | 5 +- .../pkg/apis/monitoring/v1/probe_types.go | 5 +- .../apis/monitoring/v1/prometheus_types.go | 12 +- .../monitoring/v1/servicemonitor_types.go | 9 + .../pkg/apis/monitoring/v1/thanos_types.go | 17 ++ .../pkg/apis/monitoring/v1/types.go | 81 +++++- .../monitoring/v1/zz_generated.deepcopy.go | 272 +++++++++++++++++- vendor/golang.org/x/sync/errgroup/errgroup.go | 118 ++------ vendor/modules.txt | 6 +- 12 files changed, 532 insertions(+), 126 deletions(-) diff --git a/go.mod b/go.mod index 47becfa4c..056c751a4 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/openshift/api v0.0.0-20250710082954-674ad74beffc github.com/openshift/client-go v0.0.0-20250710075018-396b36f983ee github.com/operator-framework/api v0.32.0 - github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.83.0 + github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.84.0 github.com/prometheus/client_golang v1.22.0 github.com/regclient/regclient v0.9.0 github.com/sirupsen/logrus v1.9.3 @@ -135,10 +135,10 @@ require ( golang.org/x/crypto v0.39.0 // indirect golang.org/x/net v0.41.0 // indirect golang.org/x/oauth2 v0.30.0 // indirect - golang.org/x/sync v0.15.0 // indirect + golang.org/x/sync v0.16.0 // indirect golang.org/x/sys v0.33.0 // indirect golang.org/x/term v0.32.0 // indirect - golang.org/x/text v0.26.0 // indirect + golang.org/x/text v0.27.0 // indirect golang.org/x/time v0.12.0 // indirect golang.org/x/tools v0.34.0 // indirect gomodules.xyz/jsonpatch/v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 272d350c5..6fee586aa 100644 --- a/go.sum +++ b/go.sum @@ -260,8 +260,8 @@ github.com/poy/onpar v1.1.2 h1:QaNrNiZx0+Nar5dLgTVp5mXkyoVFIbepjyEoGSnhbAY= github.com/poy/onpar v1.1.2/go.mod h1:6X8FLNoxyr9kkmnlqpK6LSoiOtrO6MICtWwEuWkLjzg= github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g= github.com/prashantv/gostub v1.1.0/go.mod h1:A5zLQHz7ieHGG7is6LLXLz7I8+3LZzsrV0P1IAHhP5U= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.83.0 h1:j9Ce3W6X6Tzi0QnSap+YzGwpqJLJGP/7xV6P9f86jjM= -github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.83.0/go.mod h1:sSxwdmprUfmRfTknPc4KIjUd2ZIc/kirw4UdXNhOauM= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.84.0 h1:V/HLst0rSw4BZp8nIqhaTnnW4/EGxEoYbgjcDqzPJ5U= +github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.84.0/go.mod h1:MruMqbSS9aYrKhBImrO9X9g52hwz3I0B+tcoeAwkmuM= github.com/prometheus/client_golang v1.22.0 h1:rb93p9lokFEsctTys46VnV1kLCDpVZ0a/Y92Vm0Zc6Q= github.com/prometheus/client_golang v1.22.0/go.mod h1:R7ljNsLXhuQXYZYtw6GAE9AZg8Y7vEW5scdCXrWRXC0= github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk= @@ -405,8 +405,8 @@ golang.org/x/oauth2 v0.30.0/go.mod h1:B++QgG3ZKulg6sRPGD/mqlHQs5rB3Ml9erfeDY7xKl golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8= -golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= +golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -420,8 +420,8 @@ golang.org/x/term v0.32.0 h1:DR4lr0TjUs3epypdhTOkMmuF5CDFJ/8pOnbzMZPQ7bg= golang.org/x/term v0.32.0/go.mod h1:uZG1FhGx848Sqfsq4/DlJr3xGGsYMu/L5GW4abiaEPQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M= -golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA= +golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= +golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= golang.org/x/time v0.12.0 h1:ScB/8o8olJvc+CQPWrK3fPZNfh7qgwCrY0zJmoEQLSE= golang.org/x/time v0.12.0/go.mod h1:CDIdPxbZBQxdj6cxyCIdrNogrJKMJ7pr37NYpMcMDSg= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/alertmanager_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/alertmanager_types.go index 372623bdd..94a94c633 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/alertmanager_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/alertmanager_types.go @@ -103,7 +103,7 @@ type AlertmanagerSpec struct { BaseImage string `json:"baseImage,omitempty"` // An optional list of references to secrets in the same namespace // to use for pulling prometheus and alertmanager images from registries - // see http://kubernetes.io/docs/user-guide/images#specifying-imagepullsecrets-on-a-pod + // see https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/ ImagePullSecrets []v1.LocalObjectReference `json:"imagePullSecrets,omitempty"` // Secrets is a list of Secrets in the same namespace as the Alertmanager // object, which shall be mounted into the Alertmanager Pods. @@ -330,7 +330,7 @@ type AlertmanagerConfigMatcherStrategy struct { // // The default value is `OnNamespace`. // - // +kubebuilder:validation:Enum="OnNamespace";"None" + // +kubebuilder:validation:Enum="OnNamespace";"OnNamespaceExceptForAlertmanagerNamespace";"None" // +kubebuilder:default:="OnNamespace" Type AlertmanagerConfigMatcherStrategyType `json:"type,omitempty"` } @@ -343,6 +343,12 @@ const ( // label equal to the namespace of the object. OnNamespaceConfigMatcherStrategyType AlertmanagerConfigMatcherStrategyType = "OnNamespace" + // With `OnNamespaceExceptForAlertmanagerNamespace`, the route and inhibition rules of an + // AlertmanagerConfig object only process alerts that have a `namespace` + // label equal to the namespace of the object, unless the AlertmanagerConfig object + // is in the same namespace as the Alertmanager object, where it will process all alerts. + OnNamespaceExceptForAlertmanagerNamespaceConfigMatcherStrategyType AlertmanagerConfigMatcherStrategyType = "OnNamespaceExceptForAlertmanagerNamespace" + // With `None`, the route and inhbition rules of an AlertmanagerConfig // object process all incoming alerts. NoneConfigMatcherStrategyType AlertmanagerConfigMatcherStrategyType = "None" @@ -390,6 +396,25 @@ type AlertmanagerGlobalConfig struct { // The default Pagerduty URL. PagerdutyURL *string `json:"pagerdutyUrl,omitempty"` + + // The default Telegram config + TelegramConfig *GlobalTelegramConfig `json:"telegram,omitempty"` + + // The default configuration for Jira. + JiraConfig *GlobalJiraConfig `json:"jira,omitempty"` + + // The default configuration for VictorOps. + VictorOpsConfig *GlobalVictorOpsConfig `json:"victorops,omitempty"` + + // The default configuration for Rocket Chat. + RocketChatConfig *GlobalRocketChatConfig `json:"rocketChat,omitempty"` + + // The default configuration for Jira. + WebexConfig *GlobalWebexConfig `json:"webex,omitempty"` + + // The default WeChat Config + // +optional + WeChatConfig *GlobalWeChatConfig `json:"wechat,omitempty"` } // AlertmanagerStatus is the most recent observed status of the Alertmanager cluster. Read-only. @@ -505,6 +530,88 @@ type GlobalSMTPConfig struct { TLSConfig *SafeTLSConfig `json:"tlsConfig,omitempty"` } +// GlobalTelegramConfig configures global Telegram parameters. +type GlobalTelegramConfig struct { + // The default Telegram API URL. + // + // It requires Alertmanager >= v0.24.0. + // +optional + APIURL *URL `json:"apiURL,omitempty"` +} + +// GlobalJiraConfig configures global Jira parameters. +type GlobalJiraConfig struct { + // The default Jira API URL. + // + // It requires Alertmanager >= v0.28.0. + // + // +optional + APIURL *URL `json:"apiURL,omitempty"` +} + +// GlobalRocketChatConfig configures global Rocket Chat parameters. +type GlobalRocketChatConfig struct { + // The default Rocket Chat API URL. + // + // It requires Alertmanager >= v0.28.0. + // + // +optional + APIURL *URL `json:"apiURL,omitempty"` + + // The default Rocket Chat token. + // + // It requires Alertmanager >= v0.28.0. + // + // +optional + Token *v1.SecretKeySelector `json:"token,omitempty"` + + // The default Rocket Chat Token ID. + // + // It requires Alertmanager >= v0.28.0. + // + // +optional + TokenID *v1.SecretKeySelector `json:"tokenID,omitempty"` +} + +// GlobalWebexConfig configures global Webex parameters. +// See https://prometheus.io/docs/alerting/latest/configuration/#configuration-file +type GlobalWebexConfig struct { + // The default Webex API URL. + // + // It requires Alertmanager >= v0.25.0. + // + // +optional + APIURL *URL `json:"apiURL,omitempty"` +} + +type GlobalWeChatConfig struct { + // The default WeChat API URL. + // The default value is "https://qyapi.weixin.qq.com/cgi-bin/" + // +optional + APIURL *URL `json:"apiURL,omitempty"` + + // The default WeChat API Secret. + // +optional + APISecret *v1.SecretKeySelector `json:"apiSecret,omitempty"` + + // The default WeChat API Corporate ID. + // +optional + // +kubebuilder:validation:MinLength=1 + APICorpID *string `json:"apiCorpID,omitempty"` +} + +// GlobalVictorOpsConfig configures global VictorOps parameters. +type GlobalVictorOpsConfig struct { + // The default VictorOps API URL. + // + // +optional + APIURL *URL `json:"apiURL,omitempty"` + // The default VictorOps API Key. + // + // +optional + APIKey *v1.SecretKeySelector `json:"apiKey,omitempty"` +} + // HostPort represents a "host:port" network address. type HostPort struct { // Defines the host's address, it can be a DNS name or a literal IP address. @@ -572,3 +679,7 @@ type ClusterTLSConfig struct { // +required ClientTLS SafeTLSConfig `json:"client"` } + +// URL represents a valid URL +// +kubebuilder:validation:Pattern:="^(http|https)://.+$" +type URL string 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 17ee448fb..ee0f25086 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 @@ -318,11 +318,8 @@ type PodMetricsEndpoint struct { // +optional RelabelConfigs []RelabelConfig `json:"relabelings,omitempty"` - // `proxyURL` configures the HTTP Proxy URL (e.g. - // "http://proxyserver:2195") to go through when scraping the target. - // // +optional - ProxyURL *string `json:"proxyUrl,omitempty"` + ProxyConfig `json:",inline"` // `followRedirects` defines whether the scrape requests should follow HTTP // 3xx redirects. 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 208de742f..c565b7d9b 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 @@ -215,8 +215,9 @@ type ProberSpec struct { // Defaults to `/probe`. // +kubebuilder:default:="/probe" Path string `json:"path,omitempty"` - // Optional ProxyURL. - ProxyURL string `json:"proxyUrl,omitempty"` + + // +optional + ProxyConfig `json:",inline"` } // ProbeList is a list of Probes. 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 32554759a..d4a6b79a5 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 @@ -716,6 +716,12 @@ type CommonPrometheusFields struct { // +optional ConvertClassicHistogramsToNHCB *bool `json:"convertClassicHistogramsToNHCB,omitempty"` + // Whether to scrape a classic histogram that is also exposed as a native histogram. + // It requires Prometheus >= v3.5.0. + // + // +optional + ScrapeClassicHistograms *bool `json:"scrapeClassicHistograms,omitempty"` + // Minimum number of seconds for which a newly created Pod should be ready // without any of its container crashing for it to be considered available. // Defaults to 0 (pod will be considered available as soon as it is ready) @@ -768,7 +774,7 @@ type CommonPrometheusFields struct { // Use the host's network namespace if true. // // Make sure to understand the security implications if you want to enable - // it (https://kubernetes.io/docs/concepts/configuration/overview/). + // it (https://kubernetes.io/docs/concepts/configuration/overview/ ). // // When hostNetwork is enabled, this will set the DNS policy to // `ClusterFirstWithHostNet` automatically (unless `.spec.DNSPolicy` is set @@ -1992,6 +1998,10 @@ type APIServerConfig struct { // // Deprecated: this will be removed in a future release. BearerToken string `json:"bearerToken,omitempty"` + + // Optional ProxyConfig. + // +optional + ProxyConfig `json:",inline"` } // +kubebuilder:validation:Enum=v1;V1;v2;V2 diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/servicemonitor_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/servicemonitor_types.go index 6c739ea3b..250c4cdde 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/servicemonitor_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/servicemonitor_types.go @@ -28,6 +28,7 @@ const ( // +genclient // +k8s:openapi-gen=true // +kubebuilder:resource:categories="prometheus-operator",shortName="smon" +// +kubebuilder:subresource:status // The `ServiceMonitor` custom resource definition (CRD) defines how `Prometheus` and `PrometheusAgent` can scrape metrics from a group of services. // Among other things, it allows to specify: @@ -43,6 +44,14 @@ type ServiceMonitor struct { // Specification of desired Service selection for target discovery by // Prometheus. Spec ServiceMonitorSpec `json:"spec"` + // This Status subresource is under active development and is updated only when the + // "StatusForConfigurationResources" feature gate is enabled. + // + // Most recent observed status of the ServiceMonitor. Read-only. + // More info: + // https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + // +optional + Status ConfigResourceStatus `json:"status,omitempty"` } // DeepCopyObject implements the runtime.Object interface. diff --git a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go index 685f02e3d..e282fa9f9 100644 --- a/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go +++ b/vendor/github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1/thanos_types.go @@ -287,6 +287,23 @@ type ThanosRulerSpec struct { // +kubebuilder:default:="15s" EvaluationInterval Duration `json:"evaluationInterval,omitempty"` + // Max time to tolerate prometheus outage for restoring "for" state of alert. + // It requires Thanos >= v0.30.0. + // +optional + RuleOutageTolerance *Duration `json:"ruleOutageTolerance,omitempty"` + + // The default rule group's query offset duration to use. + // It requires Thanos >= v0.38.0. + // +optional + RuleQueryOffset *Duration `json:"ruleQueryOffset,omitempty"` + + // How many rules can be evaluated concurrently. + // It requires Thanos >= v0.37.0. + // +kubebuilder:validation:Minimum=1 + // + // +optional + RuleConcurrentEval *int32 `json:"ruleConcurrentEval,omitempty"` + // Time duration ThanosRuler shall retain data for. Default is '24h', and // must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)` (milliseconds // seconds minutes hours days weeks years). 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 70ff6ae4e..7d98c5fac 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 @@ -268,6 +268,13 @@ const ( // - False: the reconciliation failed. // - Unknown: the operator couldn't determine the condition status. Reconciled ConditionType = "Reconciled" + // Accepted indicates whether the workload controller has successfully accepted + // the configuration resource and updated the configuration of the workload accordingly. + // The possible status values for this condition type are: + // - True: the configuration resource was successfully accepted by the controller and written to the configuration secret. + // - False: the controller rejected the configuration due to an error. + // - Unknown: the operator couldn't determine the condition status. + Accepted ConditionType = "Accepted" ) // +kubebuilder:validation:MinLength=1 @@ -306,21 +313,21 @@ type EmbeddedObjectMetadata struct { // automatically. Name is primarily intended for creation idempotence and configuration // definition. // Cannot be updated. - // More info: http://kubernetes.io/docs/user-guide/identifiers#names + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/ // +optional Name string `json:"name,omitempty" protobuf:"bytes,1,opt,name=name"` // Map of string keys and values that can be used to organize and categorize // (scope and select) objects. May match selectors of replication controllers // and services. - // More info: http://kubernetes.io/docs/user-guide/labels + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ // +optional Labels map[string]string `json:"labels,omitempty" protobuf:"bytes,11,rep,name=labels"` // Annotations is an unstructured key value map stored with a resource that may be // set by external tools to store and retrieve arbitrary metadata. They are not // queryable and should be preserved when modifying objects. - // More info: http://kubernetes.io/docs/user-guide/annotations + // More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ // +optional Annotations map[string]string `json:"annotations,omitempty" protobuf:"bytes,12,rep,name=annotations"` } @@ -645,11 +652,8 @@ type Endpoint struct { // +optional RelabelConfigs []RelabelConfig `json:"relabelings,omitempty"` - // `proxyURL` configures the HTTP Proxy URL (e.g. - // "http://proxyserver:2195") to go through when scraping the target. - // // +optional - ProxyURL *string `json:"proxyUrl,omitempty"` + ProxyConfig `json:",inline"` // `followRedirects` defines whether the scrape requests should follow HTTP // 3xx redirects. @@ -1015,3 +1019,66 @@ const ( SelectorMechanismRelabel SelectorMechanism = "RelabelConfig" SelectorMechanismRole SelectorMechanism = "RoleSelector" ) + +// ConfigResourceStatus is the most recent observed status of the Configuration Resource (ServiceMonitor, PodMonitor and Probes). Read-only. +// More info: +// https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#spec-and-status +// +k8s:openapi-gen=true +type ConfigResourceStatus struct { + // The list of workload resources (Prometheus or PrometheusAgent) which select the configuration resource. + // +optional + Bindings []WorkloadBinding `json:"bindings,omitempty"` +} + +// WorkloadBinding is a link between a configuration resource and a workload resource. +// +k8s:openapi-gen=true +type WorkloadBinding struct { + // The group of the referenced resource. + // +kubebuilder:validation:Enum=monitoring.coreos.com + // +required + Group string `json:"group"` + // The type of resource being referenced (e.g. Prometheus or PrometheusAgent). + // +kubebuilder:validation:Enum=prometheuses;prometheusagents + // +required + Resource string `json:"resource"` + // The name of the referenced object. + // +kubebuilder:validation:MinLength=1 + // +required + Name string `json:"name"` + // The namespace of the referenced object. + // +kubebuilder:validation:MinLength=1 + // +required + Namespace string `json:"namespace"` + // The current state of the configuration resource when bound to the referenced Prometheus object. + // +listType=map + // +listMapKey=type + // +optional + Conditions []ConfigResourceCondition `json:"conditions,omitempty"` +} + +// ConfigResourceCondition describes the status of configuration resources linked to Prometheus, PrometheusAgent, Alertmanager, or ThanosRuler. +// +k8s:deepcopy-gen=true +type ConfigResourceCondition struct { + // Type of the condition being reported. + // Currently, only "Accepted" is supported. + // +kubebuilder:validation:Enum=Accepted + // +required + Type ConditionType `json:"type"` + // Status of the condition. + // +required + Status ConditionStatus `json:"status"` + // LastTransitionTime is the time of the last update to the current status property. + // +required + LastTransitionTime metav1.Time `json:"lastTransitionTime"` + // Reason for the condition's last transition. + // +optional + Reason string `json:"reason,omitempty"` + // Human-readable message indicating details for the condition's last transition. + // +optional + Message string `json:"message,omitempty"` + // ObservedGeneration represents the .metadata.generation that the + // condition was set based upon. For instance, if `.metadata.generation` is + // currently 12, but the `.status.conditions[].observedGeneration` is 9, the + // condition is out of date with respect to the current state of the object. + ObservedGeneration int64 `json:"observedGeneration,omitempty"` +} 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 61b26ba87..af294d955 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 @@ -43,6 +43,7 @@ func (in *APIServerConfig) DeepCopyInto(out *APIServerConfig) { *out = new(Authorization) (*in).DeepCopyInto(*out) } + in.ProxyConfig.DeepCopyInto(&out.ProxyConfig) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new APIServerConfig. @@ -242,6 +243,36 @@ func (in *AlertmanagerGlobalConfig) DeepCopyInto(out *AlertmanagerGlobalConfig) *out = new(string) **out = **in } + if in.TelegramConfig != nil { + in, out := &in.TelegramConfig, &out.TelegramConfig + *out = new(GlobalTelegramConfig) + (*in).DeepCopyInto(*out) + } + if in.JiraConfig != nil { + in, out := &in.JiraConfig, &out.JiraConfig + *out = new(GlobalJiraConfig) + (*in).DeepCopyInto(*out) + } + if in.VictorOpsConfig != nil { + in, out := &in.VictorOpsConfig, &out.VictorOpsConfig + *out = new(GlobalVictorOpsConfig) + (*in).DeepCopyInto(*out) + } + if in.RocketChatConfig != nil { + in, out := &in.RocketChatConfig, &out.RocketChatConfig + *out = new(GlobalRocketChatConfig) + (*in).DeepCopyInto(*out) + } + if in.WebexConfig != nil { + in, out := &in.WebexConfig, &out.WebexConfig + *out = new(GlobalWebexConfig) + (*in).DeepCopyInto(*out) + } + if in.WeChatConfig != nil { + in, out := &in.WeChatConfig, &out.WeChatConfig + *out = new(GlobalWeChatConfig) + (*in).DeepCopyInto(*out) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AlertmanagerGlobalConfig. @@ -1023,6 +1054,11 @@ func (in *CommonPrometheusFields) DeepCopyInto(out *CommonPrometheusFields) { *out = new(bool) **out = **in } + if in.ScrapeClassicHistograms != nil { + in, out := &in.ScrapeClassicHistograms, &out.ScrapeClassicHistograms + *out = new(bool) + **out = **in + } if in.MinReadySeconds != nil { in, out := &in.MinReadySeconds, &out.MinReadySeconds *out = new(uint32) @@ -1170,6 +1206,44 @@ func (in *Condition) DeepCopy() *Condition { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigResourceCondition) DeepCopyInto(out *ConfigResourceCondition) { + *out = *in + in.LastTransitionTime.DeepCopyInto(&out.LastTransitionTime) +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigResourceCondition. +func (in *ConfigResourceCondition) DeepCopy() *ConfigResourceCondition { + if in == nil { + return nil + } + out := new(ConfigResourceCondition) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *ConfigResourceStatus) DeepCopyInto(out *ConfigResourceStatus) { + *out = *in + if in.Bindings != nil { + in, out := &in.Bindings, &out.Bindings + *out = make([]WorkloadBinding, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ConfigResourceStatus. +func (in *ConfigResourceStatus) DeepCopy() *ConfigResourceStatus { + if in == nil { + return nil + } + out := new(ConfigResourceStatus) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CoreV1TopologySpreadConstraint) DeepCopyInto(out *CoreV1TopologySpreadConstraint) { *out = *in @@ -1331,11 +1405,7 @@ func (in *Endpoint) DeepCopyInto(out *Endpoint) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.ProxyURL != nil { - in, out := &in.ProxyURL, &out.ProxyURL - *out = new(string) - **out = **in - } + in.ProxyConfig.DeepCopyInto(&out.ProxyConfig) if in.FollowRedirects != nil { in, out := &in.FollowRedirects, &out.FollowRedirects *out = new(bool) @@ -1383,6 +1453,56 @@ func (in *Exemplars) DeepCopy() *Exemplars { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalJiraConfig) DeepCopyInto(out *GlobalJiraConfig) { + *out = *in + if in.APIURL != nil { + in, out := &in.APIURL, &out.APIURL + *out = new(URL) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalJiraConfig. +func (in *GlobalJiraConfig) DeepCopy() *GlobalJiraConfig { + if in == nil { + return nil + } + out := new(GlobalJiraConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalRocketChatConfig) DeepCopyInto(out *GlobalRocketChatConfig) { + *out = *in + if in.APIURL != nil { + in, out := &in.APIURL, &out.APIURL + *out = new(URL) + **out = **in + } + if in.Token != nil { + in, out := &in.Token, &out.Token + *out = new(corev1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.TokenID != nil { + in, out := &in.TokenID, &out.TokenID + *out = new(corev1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalRocketChatConfig. +func (in *GlobalRocketChatConfig) DeepCopy() *GlobalRocketChatConfig { + if in == nil { + return nil + } + out := new(GlobalRocketChatConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *GlobalSMTPConfig) DeepCopyInto(out *GlobalSMTPConfig) { *out = *in @@ -1443,6 +1563,101 @@ func (in *GlobalSMTPConfig) DeepCopy() *GlobalSMTPConfig { return out } +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalTelegramConfig) DeepCopyInto(out *GlobalTelegramConfig) { + *out = *in + if in.APIURL != nil { + in, out := &in.APIURL, &out.APIURL + *out = new(URL) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalTelegramConfig. +func (in *GlobalTelegramConfig) DeepCopy() *GlobalTelegramConfig { + if in == nil { + return nil + } + out := new(GlobalTelegramConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalVictorOpsConfig) DeepCopyInto(out *GlobalVictorOpsConfig) { + *out = *in + if in.APIURL != nil { + in, out := &in.APIURL, &out.APIURL + *out = new(URL) + **out = **in + } + if in.APIKey != nil { + in, out := &in.APIKey, &out.APIKey + *out = new(corev1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalVictorOpsConfig. +func (in *GlobalVictorOpsConfig) DeepCopy() *GlobalVictorOpsConfig { + if in == nil { + return nil + } + out := new(GlobalVictorOpsConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalWeChatConfig) DeepCopyInto(out *GlobalWeChatConfig) { + *out = *in + if in.APIURL != nil { + in, out := &in.APIURL, &out.APIURL + *out = new(URL) + **out = **in + } + if in.APISecret != nil { + in, out := &in.APISecret, &out.APISecret + *out = new(corev1.SecretKeySelector) + (*in).DeepCopyInto(*out) + } + if in.APICorpID != nil { + in, out := &in.APICorpID, &out.APICorpID + *out = new(string) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalWeChatConfig. +func (in *GlobalWeChatConfig) DeepCopy() *GlobalWeChatConfig { + if in == nil { + return nil + } + out := new(GlobalWeChatConfig) + in.DeepCopyInto(out) + return out +} + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *GlobalWebexConfig) DeepCopyInto(out *GlobalWebexConfig) { + *out = *in + if in.APIURL != nil { + in, out := &in.APIURL, &out.APIURL + *out = new(URL) + **out = **in + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GlobalWebexConfig. +func (in *GlobalWebexConfig) DeepCopy() *GlobalWebexConfig { + if in == nil { + return nil + } + out := new(GlobalWebexConfig) + in.DeepCopyInto(out) + return out +} + // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *HTTPConfig) DeepCopyInto(out *HTTPConfig) { *out = *in @@ -1845,11 +2060,7 @@ func (in *PodMetricsEndpoint) DeepCopyInto(out *PodMetricsEndpoint) { (*in)[i].DeepCopyInto(&(*out)[i]) } } - if in.ProxyURL != nil { - in, out := &in.ProxyURL, &out.ProxyURL - *out = new(string) - **out = **in - } + in.ProxyConfig.DeepCopyInto(&out.ProxyConfig) if in.FollowRedirects != nil { in, out := &in.FollowRedirects, &out.FollowRedirects *out = new(bool) @@ -2054,7 +2265,7 @@ func (in *ProbeList) DeepCopy() *ProbeList { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *ProbeSpec) DeepCopyInto(out *ProbeSpec) { *out = *in - out.ProberSpec = in.ProberSpec + in.ProberSpec.DeepCopyInto(&out.ProberSpec) in.Targets.DeepCopyInto(&out.Targets) if in.TLSConfig != nil { in, out := &in.TLSConfig, &out.TLSConfig @@ -2243,6 +2454,7 @@ func (in *ProbeTargetsValidationError) DeepCopy() *ProbeTargetsValidationError { // 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 + in.ProxyConfig.DeepCopyInto(&out.ProxyConfig) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ProberSpec. @@ -3181,6 +3393,7 @@ func (in *ServiceMonitor) DeepCopyInto(out *ServiceMonitor) { out.TypeMeta = in.TypeMeta in.ObjectMeta.DeepCopyInto(&out.ObjectMeta) in.Spec.DeepCopyInto(&out.Spec) + in.Status.DeepCopyInto(&out.Status) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ServiceMonitor. @@ -3626,6 +3839,21 @@ func (in *ThanosRulerSpec) DeepCopyInto(out *ThanosRulerSpec) { *out = make([]PrometheusRuleExcludeConfig, len(*in)) copy(*out, *in) } + if in.RuleOutageTolerance != nil { + in, out := &in.RuleOutageTolerance, &out.RuleOutageTolerance + *out = new(Duration) + **out = **in + } + if in.RuleQueryOffset != nil { + in, out := &in.RuleQueryOffset, &out.RuleQueryOffset + *out = new(Duration) + **out = **in + } + if in.RuleConcurrentEval != nil { + in, out := &in.RuleConcurrentEval, &out.RuleConcurrentEval + *out = new(int32) + **out = **in + } if in.Containers != nil { in, out := &in.Containers, &out.Containers *out = make([]corev1.Container, len(*in)) @@ -3977,3 +4205,25 @@ func (in *WebTLSConfig) DeepCopy() *WebTLSConfig { in.DeepCopyInto(out) return out } + +// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. +func (in *WorkloadBinding) DeepCopyInto(out *WorkloadBinding) { + *out = *in + if in.Conditions != nil { + in, out := &in.Conditions, &out.Conditions + *out = make([]ConfigResourceCondition, len(*in)) + for i := range *in { + (*in)[i].DeepCopyInto(&(*out)[i]) + } + } +} + +// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkloadBinding. +func (in *WorkloadBinding) DeepCopy() *WorkloadBinding { + if in == nil { + return nil + } + out := new(WorkloadBinding) + in.DeepCopyInto(out) + return out +} diff --git a/vendor/golang.org/x/sync/errgroup/errgroup.go b/vendor/golang.org/x/sync/errgroup/errgroup.go index cb6bb9ad3..1d8cffae8 100644 --- a/vendor/golang.org/x/sync/errgroup/errgroup.go +++ b/vendor/golang.org/x/sync/errgroup/errgroup.go @@ -12,8 +12,6 @@ package errgroup import ( "context" "fmt" - "runtime" - "runtime/debug" "sync" ) @@ -33,10 +31,6 @@ type Group struct { errOnce sync.Once err error - - mu sync.Mutex - panicValue any // = PanicError | PanicValue; non-nil if some Group.Go goroutine panicked. - abnormal bool // some Group.Go goroutine terminated abnormally (panic or goexit). } func (g *Group) done() { @@ -56,22 +50,13 @@ func WithContext(ctx context.Context) (*Group, context.Context) { return &Group{cancel: cancel}, ctx } -// Wait blocks until all function calls from the Go method have returned -// normally, then returns the first non-nil error (if any) from them. -// -// If any of the calls panics, Wait panics with a [PanicValue]; -// and if any of them calls [runtime.Goexit], Wait calls runtime.Goexit. +// Wait blocks until all function calls from the Go method have returned, then +// returns the first non-nil error (if any) from them. func (g *Group) Wait() error { g.wg.Wait() if g.cancel != nil { g.cancel(g.err) } - if g.panicValue != nil { - panic(g.panicValue) - } - if g.abnormal { - runtime.Goexit() - } return g.err } @@ -81,53 +66,31 @@ func (g *Group) Wait() error { // It blocks until the new goroutine can be added without the number of // goroutines in the group exceeding the configured limit. // -// The first goroutine in the group that returns a non-nil error, panics, or -// invokes [runtime.Goexit] will cancel the associated Context, if any. +// The first goroutine in the group that returns a non-nil error will +// cancel the associated Context, if any. The error will be returned +// by Wait. func (g *Group) Go(f func() error) { if g.sem != nil { g.sem <- token{} } - g.add(f) -} - -func (g *Group) add(f func() error) { g.wg.Add(1) go func() { defer g.done() - normalReturn := false - defer func() { - if normalReturn { - return - } - v := recover() - g.mu.Lock() - defer g.mu.Unlock() - if !g.abnormal { - if g.cancel != nil { - g.cancel(g.err) - } - g.abnormal = true - } - if v != nil && g.panicValue == nil { - switch v := v.(type) { - case error: - g.panicValue = PanicError{ - Recovered: v, - Stack: debug.Stack(), - } - default: - g.panicValue = PanicValue{ - Recovered: v, - Stack: debug.Stack(), - } - } - } - }() - err := f() - normalReturn = true - if err != nil { + // It is tempting to propagate panics from f() + // up to the goroutine that calls Wait, but + // it creates more problems than it solves: + // - it delays panics arbitrarily, + // making bugs harder to detect; + // - it turns f's panic stack into a mere value, + // hiding it from crash-monitoring tools; + // - it risks deadlocks that hide the panic entirely, + // if f's panic leaves the program in a state + // that prevents the Wait call from being reached. + // See #53757, #74275, #74304, #74306. + + if err := f(); err != nil { g.errOnce.Do(func() { g.err = err if g.cancel != nil { @@ -152,7 +115,19 @@ func (g *Group) TryGo(f func() error) bool { } } - g.add(f) + g.wg.Add(1) + go func() { + defer g.done() + + if err := f(); err != nil { + g.errOnce.Do(func() { + g.err = err + if g.cancel != nil { + g.cancel(g.err) + } + }) + } + }() return true } @@ -174,34 +149,3 @@ func (g *Group) SetLimit(n int) { } g.sem = make(chan token, n) } - -// PanicError wraps an error recovered from an unhandled panic -// when calling a function passed to Go or TryGo. -type PanicError struct { - Recovered error - Stack []byte // result of call to [debug.Stack] -} - -func (p PanicError) Error() string { - if len(p.Stack) > 0 { - return fmt.Sprintf("recovered from errgroup.Group: %v\n%s", p.Recovered, p.Stack) - } - return fmt.Sprintf("recovered from errgroup.Group: %v", p.Recovered) -} - -func (p PanicError) Unwrap() error { return p.Recovered } - -// PanicValue wraps a value that does not implement the error interface, -// recovered from an unhandled panic when calling a function passed to Go or -// TryGo. -type PanicValue struct { - Recovered any - Stack []byte // result of call to [debug.Stack] -} - -func (p PanicValue) String() string { - if len(p.Stack) > 0 { - return fmt.Sprintf("recovered from errgroup.Group: %v\n%s", p.Recovered, p.Stack) - } - return fmt.Sprintf("recovered from errgroup.Group: %v", p.Recovered) -} diff --git a/vendor/modules.txt b/vendor/modules.txt index 18807353b..060273185 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -374,7 +374,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.83.0 +# github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring v0.84.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 @@ -558,7 +558,7 @@ golang.org/x/net/websocket ## explicit; go 1.23.0 golang.org/x/oauth2 golang.org/x/oauth2/internal -# golang.org/x/sync v0.15.0 +# golang.org/x/sync v0.16.0 ## explicit; go 1.23.0 golang.org/x/sync/errgroup golang.org/x/sync/semaphore @@ -570,7 +570,7 @@ golang.org/x/sys/windows # golang.org/x/term v0.32.0 ## explicit; go 1.23.0 golang.org/x/term -# golang.org/x/text v0.26.0 +# golang.org/x/text v0.27.0 ## explicit; go 1.23.0 golang.org/x/text/encoding golang.org/x/text/encoding/charmap