1
0
mirror of https://github.com/coreos/prometheus-operator.git synced 2026-02-05 15:46:31 +01:00

525 Commits

Author SHA1 Message Date
kartik
69b36538b3 fix: validate nonzero duration in AlertmanagerConfig (#8126)
* add valid alertmanagerconfig

* update validation check for global alertmanagerconfig object

* add validation marker

* add e2e test for amcfg

* fix depedency issues

* add sanitization logic & monitorv1duration field

* update tests with monitorv1duration field logic

* validate and update fields

* update import dependencies

* update unnecessary groupwait conversion

* update generated files and formatting

* update error handling && refine methods

* nonemptyduration validation for groupwait

* retrigger CI

* update validation for groupwait

* remove toplevel route validation for intervals

* simplify handling of zero durations

Zero durations are converted to empty strings which makes use of the
default value defined at a higher level in the routing tree.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Fix generated file

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* Fix test compilation

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

---------

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2026-02-05 10:26:44 +00:00
Simon Pasquier
dd0a792438 Add end-to-end tests for Alertmanager and ThanosRuler
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2026-02-04 10:18:57 +01:00
Simon Pasquier
f61936b22d test: add test for #8312
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2026-02-04 10:17:05 +01:00
Hélia Barroso
446c84244d fix: sns templating issue (#8320)
* fix: sns templating issue
2026-01-29 15:55:23 +05:30
Simon Pasquier
3bdb9c0537 fix: relax URL validation on WebhookConfig
Relates to #8315

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2026-01-28 08:54:00 +05:30
Nutmos
e7e119fbba Feat: Add validations to SNS Receiver in Alertmanager Config CR (#8217)
* api: update variable type

to match the type of optional and add more validation

* am-validation: add url validation and test case

to semantically verify URL

* alertmanager: move test case to operator

to validate at the correct part

* validation: update validation method and error message

for a clear validation and clean code

* validation: update validationSnsConfig method

to let the compiler guess variable type

* validation: update import order

to fix golang lint check

* trigger ci
2026-01-13 21:06:54 +01:00
Nutmos
455778f38c Merge pull request #8271 from nutmos/feat/wechat-receiver-string-validation
Feat: Add WeChat Receiver String Validations
2026-01-13 16:54:29 +01:00
Nutmos
7cf511edf6 Feat: Add validations to Email Receiver in Alertmanager Config (#8270)
* alertmanager: update type of variables in email config

to have stricter validation

* amcfg: update test cases

to match the new variable type

* e2e: update test cases

to match new var type

* validation: update error log

to match variable type

* api: allow empty string in html

to align with the expected behaviour
2026-01-13 14:45:14 +01:00
Nutmos
37ac74f402 Merge pull request #8235 from nutmos/feat/add-slack-validations
Feat: Add Validations to Slack Receiver in Alertmanager Config CR
2026-01-07 14:19:49 +01:00
slashexx
2f624871ef add remaining CEL Validations
Signed-off-by: slashexx <dhruvpuri.35@gmail.com>
2026-01-07 10:39:09 +05:30
Nutmos
0a6303acba Feat: Add validations for PagerDuty Receiver in Alertmanager Config CR (#8113)
* change type to url, remove operator check and add semantic validation

* update conversion config

* trigger ci

* change url to pointer and regenerate files

* add empty string test case

* update test case

* update url

* update back url validation in operator

* trigger ci

* remove url validation from operator

* trigger ci

* add exclusion of empty string

* fix typo

* add e2e test case for url

* alertmanager: update optional var type to *string and add minlength validation

to have stricter validation

* validation: update url validation

to use the new method validatURLPtr

* alertmanager: change href to URL and add validation

to cover more cases
2026-01-06 15:41:08 +01:00
Simon Pasquier
bcf1866513 Merge pull request #8202 from simonpasquier/support-update-strategy
feat: expose update strategy for workloads
2026-01-05 11:59:01 +01:00
Nutmos
6a92553ec0 Feat: Add URL validation for Webhook receiver (#8125)
* update to url type

* update generated files

* update e2e test cases

* trigger ci

* update url validation method

* trigger ci

* validation: update validation method

make the url validation shorter
2025-12-24 15:12:05 +01:00
Simon Pasquier
19febac62b feat: expose update strategy for workloads
This commit introduces a new `updateStrategy` field for
statefulset-based workloads (Prometheus, PrometheusAgent, Alertmanager
and ThanosRuler). While for now, there's a 1:1 mapping with StatefulSet
strategies, it paves the way to the introduction of custom strategies
which may be required to streamline operations in case of broken updates
(similar to the scenario explained in
https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#forced-rollback).

Closes #5435

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-12-23 14:31:34 +01:00
Nutmos
b4b6cd8d21 Feat: Add API URL validation for Telegram receiver in CR (#8199)
* change api url to url type and add validation

* update test case
2025-12-22 13:34:36 +01:00
Simon Pasquier
4fc65465fa chore: unify HTTP configuration for ServiceMonitor CRD (#8139)
* chore: unify HTTP configuration for ServiceMonitor CRD

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* test: fix Alertmanager unit tests

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* test: fix Prometheus unit tests

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* test: fix e2e tests

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* test: fix pkg/apis/monitoring tests

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

---------

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-12-19 13:11:51 +01:00
Simon Pasquier
24d828c680 feat: add new NoSelectedResources reason
This commit introduces the `NoSelectedResources` reason for the
`Reconciled` condition when a workload object selects no resources
(valid or invalid). It should make it easier to detect when resource
selectors are null or match no resource.

The `Alertmanager` resource is the exception because the configuration
may be provided only via a reference to a Secret key.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-12-01 11:44:43 +01:00
Simon Pasquier
1bbd19e13e Merge pull request #8123 from simonpasquier/fix-test
test: fix testStuckStatefulSetRollout
2025-11-28 20:05:46 +01:00
Simon Pasquier
fb6d4439a2 Merge pull request #8112 from simonpasquier/unify-http-config-for-probes
feat: unify HTTP configuration for Probe CRD
2025-11-28 16:23:56 +01:00
Simon Pasquier
b6c1bb9dbb test: fix testStuckStatefulSetRollout
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-11-28 15:56:45 +01:00
Simon Pasquier
43cc1e16ad Merge pull request #8120 from simonpasquier/change-default-args
change: add new arguments to manifests
2025-11-28 14:56:57 +01:00
Simon Pasquier
350bde905b test: ensure that bad rollouts can be reverted
This commit adds a test ensuring that a bad statefulset definition (due
to an invalid image in this case) doesn't lead to a stuck roll-out once
the definition is fixed.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-11-28 14:09:41 +01:00
Simon Pasquier
355cd36130 change: add new arguments to manifests
This commit adds the following arguments in jsonnet + default manifests:

* `--watch-referenced-objects-in-all-namespaces=true`
* `--disable-unmanaged-prometheus-configuration=true`

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-11-28 12:43:51 +01:00
Simon Pasquier
ca5bf4a119 feat: unify HTTP configuration for Probe CRD
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-11-21 17:42:25 +01:00
Jayapriya Pai
bf79619068 tests: skip UTF8 e2e tests for Prometheus V2 (#8087)
* Revert "test: fix testPrometheusUTF8LabelSupport for Prometheus V2"

This reverts commit fdeaa44a81.

* tests: skip utf8 tests for prometheus v2

Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>

---------

Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
2025-11-12 14:12:59 +01:00
Y@&h
3ab43822d2 Merge pull request #8086 from yp969803/issue8068
prometheusRule binding cleanup in thanousRuler
2025-11-12 13:47:40 +01:00
Y@&h
814f26fb56 Merge pull request #8069 from yp969803/issue8067
PrometheusRule status update after reconcillation from thanosRuler
2025-11-10 14:44:44 +00:00
Simon Pasquier
fad6a8f22c test: fix RmPrometheusRuleBindingDuringWorkloadDelete
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-11-07 14:06:30 +01:00
dongjiang
fcc78c7e07 change sort to slices package
Signed-off-by: dongjiang <dongjiang1989@126.com>
2025-11-04 16:28:38 +08:00
Y@&h
84231e573f add finalizer syncer for Thanos Ruler (#8060) 2025-11-03 13:45:33 +01:00
Y@&h
0ecdf47862 Cleanup of bindings for PrometheusRules in prometheus (#8024) 2025-10-17 17:25:49 +02:00
Simon Pasquier
a2d5da1922 Merge pull request #8017 from simonpasquier/consistent-scheme-type
chore: update documentation for the 'scheme' field
2025-10-16 16:48:49 +02:00
Simon Pasquier
79fb2e3486 Merge pull request #8010 from simonpasquier/fix-5085-2
feat: avoid statefulset's rollout due to new rule configmaps
2025-10-16 13:05:43 +02:00
Simon Pasquier
80553769d5 feat: avoid statefulset's rollout due to new rule configmaps
This commit avoids the situation where the operator would update the
StatefulSet because the concatenation of configured rules exceeds the
maximum ConfigMap size. To alleviate the issue, the operator now
configures the StatefulSet to always mount 3 "rule" ConfigMaps with
"optional: true". When the operator generates an additional ConfigMap,
it will get mounted automatically into the pod and the config-reloader
sidecar will detect and apply the new configuration. When the
number of "concrete" ConfigMaps decreases, the operation is also
non-disruptive.

The number has been chosen arbitrarily and it could change in the future
but 3 seems a good choice (original reports were complaining about the
number of ConfigMaps fluctuating between 1 and 2).

The change applies both to Prometheus and ThanosRuler.

Closes #5085

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-10-15 11:04:23 +02:00
Jayapriya Pai
fdeaa44a81 test: fix testPrometheusUTF8LabelSupport for Prometheus V2
Assisted-By: Cursor
Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
2025-10-15 13:17:20 +05:30
Simon Pasquier
8116f769c1 chore: update documentation for the 'scheme' field
This commit also clarifies the meaning of the 'url' field in the Prober
spec which isn't a "true" URL.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-10-10 16:09:57 +02:00
Y@&h
4ca908cb21 PrometheusRule status update after reconcillation from prometheus (#8005) 2025-10-10 10:12:41 +00:00
Simon Pasquier
51cba2baef Merge pull request #7975 from simonpasquier/drop-invalid-authn-settings
fix: prevent duplicate authentication settings in PodMonitor
2025-10-07 15:09:09 +02:00
Jayapriya Pai
a2e1f38665 feat: allow UTF-8 characters in label names
Follow-up from #7637 to complete the UTF8 support for labels

Related-to: #7362

Assisted-by: Cursor
Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
2025-10-07 14:26:37 +05:30
dongjiang
1936e40708 feat: Remove binding from Probe's status when workload deletd or invalid Ref (#7980)
---------

Signed-off-by: dongjiang <dongjiang1989@126.com>
2025-10-06 12:20:26 +02:00
Jayapriya Pai
cc19d0e3fc feat: add support for UTF8 labels and rules (#7637)
for admission webhook default is legacy validation

Assissted-By: Cursor
Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2025-10-06 15:03:21 +05:30
Simon Pasquier
431f734509 fix: prevent duplicate authentication settings in PodMonitor
This commit ensures that the operator discards PodMonitor resources with
duplicate authentication settings. Otherwise Prometheus fails to load
the generated configuration.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
2025-10-03 15:52:13 +02:00
Y@&h
3b33e68495 ScrapeConfig Status Subresource Removal from prometheus (#7969) 2025-10-03 09:49:21 +02:00
Y@&h
ca51ba7f8f ScrapeConfig status update at reconcillation (#7964) 2025-10-02 12:06:46 +02:00
Nutmos
15a6fc950a Merge pull request #7966 from nutmos/refactor-kuma-sd
Chore: Refactor KumaSD
2025-10-02 09:22:21 +02:00
dongjiang
4f2b3121a8 feat: update probe status subresource on Prometheus reconciliations (#7934)
---------

Signed-off-by: dongjiang <dongjiang1989@126.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2025-09-24 10:41:43 +02:00
Y@&h
7a2bb75866 Remove binding from PodMonitor's status when workload deletd or invalid Ref (#7936)
* feat:  PodMonitor binding removal

* feat: tests for binding removals from podMon status
2025-09-23 07:41:58 +00:00
Hélia Barroso
69076602c7 feat: add spell check workflow (#7909)
* feat: add spell check workflow

Signed-off-by: Hélia Barroso <helia_barroso@hotmail.com>

* fix: test names

Signed-off-by: Hélia Barroso <helia_barroso@hotmail.com>

---------

Signed-off-by: Hélia Barroso <helia_barroso@hotmail.com>
2025-09-22 14:29:59 +02:00
Y@&h
50a1645ea7 Update PodMonitor's status subresource on Prometheus reconciliations (#7929) 2025-09-17 15:52:10 +02:00
Y@&h
7b38255e11 Merge pull request #7896 from yp969803/issue7884
Config Status Subresource finalizer in prometheusAgent
2025-09-16 08:26:13 +00:00