Repository navigation
Feat: Add botToken support for Telegram in Alertmanager global config CR - #8403
Conversation
to support the new field in CR
to align with the receiver config
as it may be added in the global config
to ensure the coverage of validity check of bot token
to align with golang linter
to cover the case when bot token specified in the global config
|
Waiting for #8465 |
to ensure it validates non-empty string
to ensure it is correctly placed
to ensure it is correctly check the version
remove debugging
|
@simonpasquier Could you please have a look? |
| } | ||
|
|
||
| // Confirm botToken is specified for either global or receiver | ||
| if out.BotToken == "" && out.BotTokenFile == "" { |
There was a problem hiding this comment.
IIUC this situation is impossible because we enforce the presence of either BotToken or BotTokenFile when selecting AlertmanagerConfig resources.
There was a problem hiding this comment.
@simonpasquier Could you please point out where this logic is implemented? I tried to find it myself already but haven't seen anything.
|
@simonpasquier Hi, could you please review this? |
to cover more scenarios
simplify test cases
to ensure conversion throws error when version does not support
to align with other functions
to match the file name in the test file
move to the new PR
remove unrelated tests
fix linter
fix the issue of unmatch generated files
|
@simonpasquier @heliapb Hi, any chance to review this PR? |
| } | ||
|
|
||
| if tc.BotToken != nil { | ||
| if _, err := cb.store.GetSecretKey(ctx, namespace, *tc.BotToken); err != nil { |
There was a problem hiding this comment.
(nit) IIUC convertGlobalTelegramConfig() will also ensure that the secret key ref is valid so we could remove the test here?
There was a problem hiding this comment.
I agree. However, the reason I implemented get secret key because I refer to other check methods, like checkTelegramConfigs in operator.go.
If you confirm this is not needed I will remove.
There was a problem hiding this comment.
it's not a big deal, we can merge as-is and fix later (I'd like to reorganize the code so that funcs are located in different files depending on their purpose).
* alertmanager: add rocket chat validation * alertmanager: add test cases to cover all rocket chat URLs * build(deps): bump github.com/prometheus/prometheus Bumps [github.com/prometheus/prometheus](https://github.com/prometheus/prometheus) from 0.314.0 to 0.315.0. - [Release notes](https://github.com/prometheus/prometheus/releases) - [Changelog](https://github.com/prometheus/prometheus/blob/main/CHANGELOG.md) - [Commits](prometheus/prometheus@v0.314.0...v0.315.0) --- updated-dependencies: - dependency-name: github.com/prometheus/prometheus dependency-version: 0.315.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump github/codeql-action/upload-sarif Bumps the github-actions-deps group with 1 update: [github/codeql-action/upload-sarif](https://github.com/github/codeql-action). Updates `github/codeql-action/upload-sarif` from 4.38.1 to 4.38.2 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@1c5b675...2892aa5) --- updated-dependencies: - dependency-name: github/codeql-action/upload-sarif dependency-version: 4.38.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions-deps ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump github.com/prometheus/exporter-toolkit Bumps [github.com/prometheus/exporter-toolkit](https://github.com/prometheus/exporter-toolkit) from 0.19.0 to 0.20.0. - [Release notes](https://github.com/prometheus/exporter-toolkit/releases) - [Commits](prometheus/exporter-toolkit@v0.19.0...v0.20.0) --- updated-dependencies: - dependency-name: github.com/prometheus/exporter-toolkit dependency-version: 0.20.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * chore: update k8s.io to v0.37.1 Signed-off-by: Simon Pasquier <[email protected]> * fix: handle unset email threading in AlertmanagerConfig conversion Converting an AlertmanagerConfig between v1beta1 and v1alpha1 panicked when an email receiver didn't set threading, because the converters dereferenced the pointer without a nil check. Since threading is optional, the conversion webhook failed for most email receivers. Return nil when threading is unset, and add the first unit tests for the conversion functions. Part of #8841 Signed-off-by: Sanchit2662 <[email protected]> * Merge pull request #8403 from nutmos/feat/telegram-bot-token-cr Feat: Add botToken support for Telegram in Alertmanager global config CR * Update PodMonitor's status subresource on PrometheusAgent reconciliations Signed-off-by: whiskey-coder <[email protected]> * Reconcile ServiceMonitor status for PrometheusAgent Reuse the configuration resource status sync to report accepted and rejected ServiceMonitors, remove stale bindings after deselection, and clean up bindings before deleting the Agent. Add feature-gated end-to-end coverage for status transitions, multiple Agents, deselection, and deletion. Signed-off-by: whiskey-coder <[email protected]> * Merge pull request #8769 from nutmos/feat/operator-separate-webhook-test Feat: enhance Webhook config test cases in operator test * chore: simplify detection of StatusForConfigurationResources feture gate Signed-off-by: Simon Pasquier <[email protected]> * build(deps): bump github.com/prometheus/common from 0.71.0 to 0.72.0 Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.71.0 to 0.72.0. - [Release notes](https://github.com/prometheus/common/releases) - [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md) - [Commits](prometheus/common@v0.71.0...v0.72.0) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-version: 0.72.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * fix: add zone info to kubelet endpointslice Signed-off-by: Simon Pasquier <[email protected]> * fix: keep Pushover ttl in AlertmanagerConfig conversion The ttl field exists on PushoverConfig in both v1beta1 and v1alpha1, but the converters never copied it. Because v1alpha1 is the storage version, a ttl set through v1beta1 was silently dropped before it reached the operator, and a ttl set through v1alpha1 was lost when the object was read and written back as v1beta1. Copy the field in both directions and add a test case for it. Closes #8841 Signed-off-by: Sanchit2662 <[email protected]> * build(deps): bump sigs.k8s.io/controller-runtime from 0.25.1 to 0.25.2 Bumps [sigs.k8s.io/controller-runtime](https://github.com/kubernetes-sigs/controller-runtime) from 0.25.1 to 0.25.2. - [Release notes](https://github.com/kubernetes-sigs/controller-runtime/releases) - [Changelog](https://github.com/kubernetes-sigs/controller-runtime/blob/main/RELEASE.md) - [Commits](kubernetes-sigs/controller-runtime@v0.25.1...v0.25.2) --- updated-dependencies: - dependency-name: sigs.k8s.io/controller-runtime dependency-version: 0.25.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * update prometheus lts version to v3.13.4 Signed-off-by: dongjiang1989 <[email protected]> * update golangci linter to v2.14.0 Signed-off-by: dongjiang1989 <[email protected]> * build(deps): bump golang.org/x/sync from 0.23.0 to 0.24.0 Bumps [golang.org/x/sync](https://github.com/golang/sync) from 0.23.0 to 0.24.0. - [Commits](golang/sync@v0.23.0...v0.24.0) --- updated-dependencies: - dependency-name: golang.org/x/sync dependency-version: 0.24.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump helm/kind-action Bumps the github-actions-deps group with 1 update: [helm/kind-action](https://github.com/helm/kind-action). Updates `helm/kind-action` from 1.15.0 to 1.15.1 - [Release notes](https://github.com/helm/kind-action/releases) - [Commits](helm/kind-action@06c1ae1...1544676) --- updated-dependencies: - dependency-name: helm/kind-action dependency-version: 1.15.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions-deps ... Signed-off-by: dependabot[bot] <[email protected]> * docs: document volume permissions for persistent storage Prometheus runs as a non-root user and the operator doesn't set a Pod security context by default. When the root directory of a persistent volume (e.g. NFS or CephFS) is owned by root, Prometheus can't write to it and crash loops. Explain how to set fsGroup in the securityContext field and when it doesn't take effect. Closes #5354 Signed-off-by: Ayman Zahran <[email protected]> * fix: improve validation for PagerDuty in CRD This commit ensures that the referenced `routingKey` and `serviceKey` values aren't empty which Alertmanager would reject. Signed-off-by: Simon Pasquier <[email protected]> * test: harden testPromReloadRules() This commit ensures that when updating a PrometheusRule, the test will retry if the rule has been updated by another actor in the meantime. Signed-off-by: Simon Pasquier <[email protected]> * build(deps): bump github.com/prometheus/client_golang Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.24.1 to 1.25.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/v1.25.0/CHANGELOG.md) - [Commits](prometheus/client_golang@v1.24.1...v1.25.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-version: 1.25.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump golang.org/x/net from 0.59.0 to 0.61.0 Bumps [golang.org/x/net](https://github.com/golang/net) from 0.59.0 to 0.61.0. - [Commits](golang/net@v0.59.0...v0.61.0) --- updated-dependencies: - dependency-name: golang.org/x/net dependency-version: 0.61.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump the github-actions-deps group with 2 updates Bumps the github-actions-deps group with 2 updates: [actions/upload-artifact](https://github.com/actions/upload-artifact) and [github/codeql-action/upload-sarif](https://github.com/github/codeql-action). Updates `actions/upload-artifact` from 7.0.1 to 7.0.2 - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](actions/upload-artifact@043fb46...cf430e0) Updates `github/codeql-action/upload-sarif` from 4.38.2 to 4.38.3 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@2892aa5...24c5418) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-version: 7.0.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions-deps - dependency-name: github/codeql-action/upload-sarif dependency-version: 4.38.3 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: github-actions-deps ... Signed-off-by: dependabot[bot] <[email protected]> * Merge pull request #8870 from nutmos/feat/add-telegram-validation feat: add Telegram receiver validation * Feat: add support for labels to route in Alertmanager secret config (#8865) * alertmanager: add route to the secret config to support new feature introduced in AM 0.34.0 * alertmanager: update test case fix version def * alertmanager: update logger warning message * alertmanager: update test file to match the result * feat: add extraScrapeMetrics to the global Prometheus configuration (#8810) * pkg/prometheus: add extraScrapeMetrics to the global configuration Prometheus supports extra_scrape_metrics in the global section since v3.10.0, and the --enable-feature=extra-scrape-metrics flag is being phased out in favor of it. Expose the setting on the shared CommonPrometheusFields so both Prometheus and PrometheusAgent can set it globally instead of repeating it in every scrape config. The field is version-gated to Prometheus >= 3.10.0, following the same pattern as the other global scrape settings. Regenerated CRDs, bundle.yaml, jsonnet, api-reference docs, deepcopy and client applyconfiguration. Fixes #8809 Signed-off-by: longyuxiang <[email protected]> * address review: inject extra-scrape-metrics feature flag for older versions - Drop the "can be overridden per scrape config" wording until the scrape CRDs (ServiceMonitor, PodMonitor, Probe, ScrapeConfig) gain the field; that stays a follow-up to keep this PR narrow. - For Prometheus >= v2.32.0 and < v3.10.0, inject --enable-feature=extra-scrape-metrics so the setting also works on versions that only support the feature flag; >= v3.10.0 keeps using the global config field. User-provided enableFeatures entries are not duplicated. - Sync the generated applyconfiguration wrappers (PrometheusSpec, PrometheusAgentSpec) and regenerate the API reference docs. Signed-off-by: longyuxiang <[email protected]> * address review: simplify flag injection and silence version warning - Drop the duplicate check before injecting extra-scrape-metrics into enable-feature: Prometheus handles duplicate values fine. - appendExtraScrapeMetrics now skips silently below v3.10.0 instead of going through WithMinimumVersion, which would log a misleading warning: those versions honor the setting thanks to the injected feature flag argument. - Simplify the field doc to 'It requires Prometheus >= v2.32.0.' as suggested. - Regenerate CRDs, bundle.yaml, jsonnet and api-reference docs. Signed-off-by: longyuxiang <[email protected]> --------- Signed-off-by: longyuxiang <[email protected]> * build(deps): bump github.com/prometheus/common from 0.72.0 to 0.72.1 Bumps [github.com/prometheus/common](https://github.com/prometheus/common) from 0.72.0 to 0.72.1. - [Release notes](https://github.com/prometheus/common/releases) - [Changelog](https://github.com/prometheus/common/blob/main/CHANGELOG.md) - [Commits](prometheus/common@v0.72.0...v0.72.1) --- updated-dependencies: - dependency-name: github.com/prometheus/common dependency-version: 0.72.1 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * pkg/apis: add extraScrapeMetrics to the scrape CRDs Follow-up to the global extraScrapeMetrics setting: allow configuring extra_scrape_metrics per scrape config via ServiceMonitor, PodMonitor, Probe and ScrapeConfig, as requested in review. Like the other per-scrape settings the field is version-gated to Prometheus >= v3.10.0 (per-scrape overrides are not honored on older versions, so the version warning applies here). Regenerated deepcopy, client applyconfigurations, CRDs, bundle.yaml, jsonnet and the API reference docs. Signed-off-by: longyuxiang <[email protected]> * feat: support log level configuration in runtime for Prometheus >= 3.15.0 when using Prometheus version 3.15.0 or higher, configure the log level in the runtime config section instead of using the command-line argument. Signed-off-by: Christoph Maser <[email protected]> * Merge pull request #8882 from AymanZahran/fix/6674-kubernetes-sd-examples docs: add Kubernetes service discovery examples for ScrapeConfig * docs: clarify that ServiceMonitor targets must be backed by Pods (#8878) * docs: clarify that ServiceMonitor targets must be backed by Pods Signed-off-by: Ayman Zahran <[email protected]> * chore: regenerate apply configurations Signed-off-by: Ayman Zahran <[email protected]> * docs: address review on ServiceMonitor Pod-backed note Signed-off-by: Ayman Zahran <[email protected]> * docs: clarify ServiceMonitor targets not backed by Pods Address review feedback: scraping Service targets without a Pod reference requires 'port' instead of 'targetPort' and 'filterRunning: false'; manually created Pods have no such restriction. ScrapeConfig is now suggested as an option rather than a requirement. Signed-off-by: Ayman Zahran <[email protected]> --------- Signed-off-by: Ayman Zahran <[email protected]> Co-authored-by: Ayman Zahran <[email protected]> * build: add distroless image variants Keep BusyBox images as the default while adding separately tagged distroless variants for the operator, config reloader, and admission webhook. Build, publish, sign, and validate the variants in CI. Relates to #8748 Signed-off-by: Sidheshwar Sarangal <[email protected]> * alertmanager: fix logs missing single quote * alertmanager: fix logs missing single quote * Merge pull request #8893 from nutmos/fix/pushover-sound-drop Feat: update Pushover CR conversion and check * fix: reject duplicate time interval names in AlertmanagerConfig Alertmanager refuses a configuration with two time intervals of the same name, which blocks every change until the object is fixed. Validate the names like the receiver names are validated, for v1alpha1 and v1beta1. Fixes #8887 Signed-off-by: Aryan Deshmukh <[email protected]> * build(deps): bump github.com/go-test/deep from 1.1.1 to 1.1.2 Bumps [github.com/go-test/deep](https://github.com/go-test/deep) from 1.1.1 to 1.1.2. - [Release notes](https://github.com/go-test/deep/releases) - [Changelog](https://github.com/go-test/deep/blob/main/CHANGES.md) - [Commits](go-test/deep@v1.1.1...v1.1.2) --- updated-dependencies: - dependency-name: github.com/go-test/deep dependency-version: 1.1.2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> * build(deps): bump the github-actions-deps group with 2 updates Bumps the github-actions-deps group with 2 updates: [github/codeql-action/upload-sarif](https://github.com/github/codeql-action) and [streetsidesoftware/cspell-action](https://github.com/streetsidesoftware/cspell-action). Updates `github/codeql-action/upload-sarif` from 4.38.3 to 4.39.0 - [Release notes](https://github.com/github/codeql-action/releases) - [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md) - [Commits](github/codeql-action@24c5418...6f2ac81) Updates `streetsidesoftware/cspell-action` from 9.1.0 to 9.2.0 - [Release notes](https://github.com/streetsidesoftware/cspell-action/releases) - [Changelog](https://github.com/streetsidesoftware/cspell-action/blob/main/CHANGELOG.md) - [Commits](streetsidesoftware/cspell-action@6f3c77c...ce1816e) --- updated-dependencies: - dependency-name: github/codeql-action/upload-sarif dependency-version: 4.39.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-deps - dependency-name: streetsidesoftware/cspell-action dependency-version: 9.2.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: github-actions-deps ... Signed-off-by: dependabot[bot] <[email protected]> * fix ci file * revert change --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Simon Pasquier <[email protected]> Signed-off-by: Sanchit2662 <[email protected]> Signed-off-by: whiskey-coder <[email protected]> Signed-off-by: dongjiang1989 <[email protected]> Signed-off-by: Ayman Zahran <[email protected]> Signed-off-by: longyuxiang <[email protected]> Signed-off-by: Christoph Maser <[email protected]> Signed-off-by: Sidheshwar Sarangal <[email protected]> Signed-off-by: Aryan Deshmukh <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Simon Pasquier <[email protected]> Co-authored-by: Sanchit2662 <[email protected]> Co-authored-by: whiskey-coder <[email protected]> Co-authored-by: dongjiang1989 <[email protected]> Co-authored-by: Ayman Zahran <[email protected]> Co-authored-by: longxiucai <[email protected]> Co-authored-by: Christoph Maser <[email protected]> Co-authored-by: Ayman Zahran <[email protected]> Co-authored-by: Sidheshwar Sarangal <[email protected]> Co-authored-by: Aryan Deshmukh <[email protected]>
…r to v0.95.1 (#2092) ##### [\`v0.95.1\`](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.95.1) Maintenance release because the CI workflow failed to publish the `v0.95.0` container images. --- ##### [\`v0.95.0\`](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.95.0) - \[CHANGE] Add `alertmanagerConfigFileSystemMode` field to the `Alertmanager` CRD controlling how to process `AlertmanagerConfig` resources which have references to files from the Alertmanager container's filesystem. - \[FEATURE] Add `extraScrapeMetrics` field to the `Prometheus` and `PrometheusAgent` CRDs. [#8810](prometheus-operator/prometheus-operator#8810) - \[FEATURE] Add `extraScrapeMetrics` field to the `ServiceMonitor`, `PodMonitor`, `Probe` and `ScrapeConfig` CRDs. [#8892](prometheus-operator/prometheus-operator#8892) - \[FEATURE] Reconcile `ScrapeConfig` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8910](prometheus-operator/prometheus-operator#8910) - \[FEATURE] Reconcile `ServiceMonitor` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8860](prometheus-operator/prometheus-operator#8860) - \[FEATURE] Reconcile `PodMonitor` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8859](prometheus-operator/prometheus-operator#8859) - \[FEATURE] Reconcile `Probe` status subresource when selected by `PrometheusAgent` custom resources (requires the `StatusForConfigurationResources` feature gate). [#8930](prometheus-operator/prometheus-operator#8930) - \[FEATURE] Reconcile `AlertmanagerConfig` status subresource on `Alertmanager` reconciliations (requires the `StatusForConfigurationResources` feature gate). [#8261](prometheus-operator/prometheus-operator#8261) - \[FEATURE] Add `labels` field to the `AlertmanagerConfig` to manage route labels. [#8761](prometheus-operator/prometheus-operator#8761) - \[FEATURE] Add support for route `labels` in the Alertmanager configuration Secret. [#8865](prometheus-operator/prometheus-operator#8865) - \[FEATURE] Add `botToken` support for the global Telegram configuration in the `Alertmanager` CRD. [#8403](prometheus-operator/prometheus-operator#8403) - \[ENHANCEMENT] Add distroless images (available under the `<version>-distroless` tag). [#8815](prometheus-operator/prometheus-operator#8815) - \[ENHANCEMENT] Add `--disable-pprof` CLI argument. [#8920](prometheus-operator/prometheus-operator#8920) - \[ENHANCEMENT] Configure the log level via the runtime configuration section instead of the `--log.level` flag for Prometheus >= `3.15.0`. [#8881](prometheus-operator/prometheus-operator#8881) - \[BUGFIX] Reject AlertmanagerConfig resources where PagerDuty `routingKey` and `serviceKey` references resolve to empty strings. [#8842](prometheus-operator/prometheus-operator#8842) - \[BUGFIX] Rollout Alertmanager pods when the cluster TLS configuration is updated. [#8840](prometheus-operator/prometheus-operator#8840) - \[BUGFIX] Pass `imagePullPolicy` to the `ThanosRuler` config-reloader sidecar. [#8916](prometheus-operator/prometheus-operator#8916) - \[BUGFIX] Make the ordering of the `ts` and `level` keys consistent in the config-reloader logs (the `ts` key always comes first). [#8913](prometheus-operator/prometheus-operator#8913) - \[BUGFIX] Reject MSTeamsV2 receivers without a webhook URL. [#8908](prometheus-operator/prometheus-operator#8908) - \[BUGFIX] Add credentials validation for Webex receivers in the `AlertmanagerConfig` CRD. [#8906](prometheus-operator/prometheus-operator#8906) [#8897](prometheus-operator/prometheus-operator#8897) - \[BUGFIX] Preserve HTTP client configuration for Azure SD in the `ScrapeConfig` CRD. [#8898](prometheus-operator/prometheus-operator#8898) - \[BUGFIX] Reject `AlertmanagerConfig` custom resources with duplicated time interval names. [#8896](prometheus-operator/prometheus-operator#8896) - \[BUGFIX] Improve validation for the PagerDuty receiver in the `AlertmanagerConfig` CRD. [#8842](prometheus-operator/prometheus-operator#8842) - \[BUGFIX] Add validation for the `clientAuthType` field in `Prometheus`, `PrometheusAgent`, `Alertmanager` and `ThanosRuler` CRDs. [#8823](prometheus-operator/prometheus-operator#8823) - \[BUGFIX] Discard unsupported fields in remote-write configuration for the `ThanosRuler` CRD. [#8813](prometheus-operator/prometheus-operator#8813) - \[BUGFIX] Add zone information to the generated kubelet EndpointSlice. [#8864](prometheus-operator/prometheus-operator#8864) - \[BUGFIX] Preserve the Pushover `ttl` field when converting `AlertmanagerConfig` resources. [#8866](prometheus-operator/prometheus-operator#8866) - \[BUGFIX] Handle unset email threading fields when converting `AlertmanagerConfig` resources. [#8858](prometheus-operator/prometheus-operator#8858) - \[BUGFIX] Add URL validation for the PagerDuty receiver in the Alertmanager configuration Secret. [#8221](prometheus-operator/prometheus-operator#8221) - \[BUGFIX] Add URL validation for the RocketChat receiver in the Alertmanager configuration Secret. [#8224](prometheus-operator/prometheus-operator#8224) - \[BUGFIX] Log errors when namespace flags conflict. [#8931](prometheus-operator/prometheus-operator#8931) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Description
This PR adds botToken support for Telegram in Alertmanager global config CR.
Key changes:
conf.BotToken == nil && conf.BotTokenFile == nilcheck from the validations.go (v1alpha1 and v1beta1)convertGlobalTelegramConfigto confirm the token is specified in either global or receivervalidatingTelegramConfigtovalidateGlobalTelegramConfigand add check for both botToken and botTokenFile in v1/validations.goType of change
What type of changes does your code introduce to the Prometheus operator? Put an
xin the box that apply.CHANGE(fix or feature that would cause existing functionality to not work as expected)FEATURE(non-breaking change which adds functionality)BUGFIX(non-breaking change which fixes an issue)ENHANCEMENT(non-breaking change which improves existing functionality)NONE(if none of the other choices apply. Example, tooling, build system, CI, docs, etc.)Verification
Unit Testing
Changelog entry