* 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>
* 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
* 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
* 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
* 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
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>
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>
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>
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>
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>
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>
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>
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>