Skip to content

fix: alertmanager slack templating bug#8299

Merged
simonpasquier merged 1 commit intoprometheus-operator:release-0.88from
heliapb:fix/am_slack_templating
Jan 22, 2026
Merged

fix: alertmanager slack templating bug#8299
simonpasquier merged 1 commit intoprometheus-operator:release-0.88from
heliapb:fix/am_slack_templating

Conversation

@heliapb
Copy link
Member

@heliapb heliapb commented Jan 20, 2026

Description

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.

Closes: ##8291

If you're contributing for the first-time, check our contribution guidelines.

Type of change

What type of changes does your code introduce to the Prometheus operator? Put an x in 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

Please check the Prometheus-Operator testing guidelines for recommendations about automated tests.

Changelog entry

Please put a one-line changelog entry below. This will be copied to the changelog file during the release process.


}

// URL represents a valid URL
// +kubebuilder:validation:Pattern=`^https?://.+$`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm I'd rather change the type of the Slack URL field?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi I understand, my main concern is this can affect other templated variables that's why I made the change. But I guess then should I just undo the url changes done in
#8235 right?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@slashpai
Copy link
Contributor

This PR should be against release-0.88 right?

@heliapb heliapb changed the base branch from main to release-0.88 January 20, 2026 17:14
@heliapb heliapb closed this Jan 20, 2026
@heliapb
Copy link
Member Author

heliapb commented Jan 20, 2026

This PR should be against release-0.88 right?

yes thanks @slashpai - fixed the branch

@heliapb heliapb reopened this Jan 20, 2026
@heliapb heliapb force-pushed the fix/am_slack_templating branch from 95bdd0f to be1a492 Compare January 20, 2026 17:24
@slashpai slashpai mentioned this pull request Jan 21, 2026
5 tasks
Copy link
Contributor

@simonpasquier simonpasquier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm currently checking if we have other PRs that we'd need to revert...

}

// URL represents a valid URL
// +kubebuilder:validation:Pattern=`^https?://.+$`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

@simonpasquier
Copy link
Contributor

simonpasquier commented Jan 21, 2026

Affected receivers other than Slack which support templated URLs:

And this is not accounting for the additional validation/sanitization happening on the generated configuration...

@simonpasquier
Copy link
Contributor

I suggest that we do the reverts step by step so let's keep this one to fix the slack config.

@heliapb
Copy link
Member Author

heliapb commented Jan 21, 2026

I suggest that we do the reverts step by step so let's keep this one to fix the slack config.

ok got it, I'll revert the slack one, give me a few mins

@heliapb heliapb force-pushed the fix/am_slack_templating branch from be1a492 to 361200f Compare January 21, 2026 14:47
@pull-request-size pull-request-size bot added size/L and removed size/M labels Jan 21, 2026
@heliapb
Copy link
Member Author

heliapb commented Jan 21, 2026

Ok undo the url changes, I'm guessing the others related to // +kubebuilder:validation:MinItems=1 from the #8235 should be fine

@heliapb
Copy link
Member Author

heliapb commented Jan 21, 2026

Will try to pick on webhook next: #8306

@simonpasquier
Copy link
Contributor

@heliapb can you sign the commit(s)?

@heliapb heliapb force-pushed the fix/am_slack_templating branch from 361200f to 455c941 Compare January 21, 2026 16:33
@heliapb
Copy link
Member Author

heliapb commented Jan 21, 2026

@heliapb can you sign the commit(s)?

Hum thought I had, reseted and pushed again.

@simonpasquier
Copy link
Contributor

for some reason, the signatures can't be verified
image

@heliapb
Copy link
Member Author

heliapb commented Jan 21, 2026

for some reason, the signatures can't be verified image

😕 - going to try to fix on my side

@heliapb heliapb force-pushed the fix/am_slack_templating branch 4 times, most recently from a1a0624 to b6f2f56 Compare January 21, 2026 17:01
@heliapb
Copy link
Member Author

heliapb commented Jan 21, 2026

for some reason, the signatures can't be verified image

😕 - going to try to fix on my side

@simonpasquier fixed

out.APIURL = url
}

if ptr.Deref(in.TitleLink, "") != "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be kept?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@heliapb heliapb force-pushed the fix/am_slack_templating branch from b6f2f56 to 383e123 Compare January 22, 2026 10:17
@heliapb heliapb force-pushed the fix/am_slack_templating branch from 383e123 to 0808755 Compare January 22, 2026 10:21
@simonpasquier simonpasquier merged commit b093b0b into prometheus-operator:release-0.88 Jan 22, 2026
22 checks passed
@simonpasquier
Copy link
Contributor

thanks!

@heliapb heliapb deleted the fix/am_slack_templating branch January 22, 2026 12:46
renovate bot added a commit to sdwilsh/ansible-playbooks that referenced this pull request Feb 21, 2026
…r to v0.89.0

##### [\`v0.89.0\`](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.89.0)

- \[ENHANCEMENT] Add `hostNetwork` field to the `Alertmanager` CRD. [#8281](prometheus-operator/prometheus-operator#8281)
- \[ENHANCEMENT] Add the `crds` and `full-crds` commands to the operator's binary. [#8251](prometheus-operator/prometheus-operator#8251)
- \[ENHANCEMENT] Report deprecated field usage in the `Reconciled` condition type. [#8236](prometheus-operator/prometheus-operator#8236)
- \[ENHANCEMENT] Avoid unnecessary reconciliation upon creation of the `ThanosRuler` StatefulSet. [#8347](prometheus-operator/prometheus-operator#8347)
- \[ENHANCEMENT] Add `bodySizeLimit` to the ScrapeConfig CRD. [#8348](prometheus-operator/prometheus-operator#8348)
- \[ENHANCEMENT] Support `http_headers` field in the Alertmanager Secret. [#8357](prometheus-operator/prometheus-operator#8357)
- \[ENHANCEMENT] Add the `-kubelet-http-metrics` flag to enable/disable the HTTP metrics port in the Kubelet endpoint (default=enabled). [#8350](prometheus-operator/prometheus-operator#8350)
- \[ENHANCEMENT] Include `operator.prometheus.io/version` annotation in the full version of CRDs. [#8279](prometheus-operator/prometheus-operator#8279)
- \[BUGFIX] Validate VictorOps global configuration in the `Alertmanager` CRD. [#8020](prometheus-operator/prometheus-operator#8020)
- \[BUGFIX] Validate Jira global configuration in the `Alertmanager` CRD. [#8265](prometheus-operator/prometheus-operator#8265)
- \[BUGFIX] Validate VictorOps receiver's URL in the `AlertmanagerConfig` CRD. [#8258](prometheus-operator/prometheus-operator#8258)
- \[BUGFIX] Validate Webex receiver's URL in the `AlertmanagerConfig` CRD. [#8255](prometheus-operator/prometheus-operator#8255)
- \[BUGFIX] Validate Jira receiver's URL configuration in the `AlertmanagerConfig` CRD. [#8230](prometheus-operator/prometheus-operator#8230)
- \[BUGFIX] Validate OpsGenie receiver configuration in the `AlertmanagerConfig` CRD. [#8267](prometheus-operator/prometheus-operator#8267)
- \[BUGFIX] Validate WeChat receiver configuration in the `AlertmanagerConfig` CRD. [#8271](prometheus-operator/prometheus-operator#8271)
- \[BUGFIX] Validate SNS receiver configuration in the `AlertmanagerConfig` CRD. [#8217](prometheus-operator/prometheus-operator#8217)
- \[BUGFIX] Validate Webex global configuration in the `Alertmanager` CRD. [#7979](prometheus-operator/prometheus-operator#7979)
- \[BUGFIX] Validate Telegram global configuration in the `Alertmanager` CRD. [#8268](prometheus-operator/prometheus-operator#8268)
- \[BUGFIX] Restore statefulset's labels if the creation fails with AlreadyExists. [#8343](prometheus-operator/prometheus-operator#8343)
- \[BUGFIX] Fix potential panic due to informer cache races. [#8310](prometheus-operator/prometheus-operator#8310)
- \[BUGFIX] Support probers defined with IPv6 addresses in the `Probe` CRD. [#8354](prometheus-operator/prometheus-operator#8354)
- \[BUGFIX] Prevent group and repeat intervals with zero duration from breaking Alertmanager. [#8126](prometheus-operator/prometheus-operator#8126)
- \[BUGFIX] Propagate all supported RocketChat attributes for `AlertmanagerConfig` CRD. [#8016](prometheus-operator/prometheus-operator#8016)
- \[BUGFIX] Add URL validation for WeChat receiver. [#8256](prometheus-operator/prometheus-operator#8256)
- \[BUGFIX] Add URL validation for SNS receiver. [#8259](prometheus-operator/prometheus-operator#8259)
- \[BUGFIX] Fix GCE service discovery for the `ScrapeConfig` CRD. [#8284](prometheus-operator/prometheus-operator#8284)
- \[BUGFIX] Avoid stale conditions in `Alertmanager`, `ThanosRuler`, `Prometheus` and `PrometheusAgent` resources. [#8304](prometheus-operator/prometheus-operator#8304)
- \[BUGFIX] Fix race condition when updating rule ConfigMaps. [#8290](prometheus-operator/prometheus-operator#8290)
- \[BUGFIX] Fix race condition when patching finalizers. [#8323](prometheus-operator/prometheus-operator#8323)
- \[BUGFIX] Reconcile `ScrapeConfig` resources when namespace selection changes. [#8334](prometheus-operator/prometheus-operator#8334)

---
##### [\`v0.88.1\`](https://github.com/prometheus-operator/prometheus-operator/releases/tag/v0.88.1)

- \[BUGFIX] Validate `webhookURL` secret for `MSTeams` receiver in `AlertmanagerConfig` CRD. [#8294](prometheus-operator/prometheus-operator#8294)
- \[BUGFIX] Revert maximum version check for `EC2/Lightsail` SD in `ScrapeConfig` CRD. [#8308](prometheus-operator/prometheus-operator#8308)
- \[BUGFIX] Relax URL validation in `Slack` receiver in AlertmanagerConfig CRD to support Go templates. [#8299](prometheus-operator/prometheus-operator#8299) [#8331](prometheus-operator/prometheus-operator#8331)
- \[BUGFIX] Relax URL validation in `PagerDuty` in AlertmanagerConfig CRD to support Go templates. [#8319](prometheus-operator/prometheus-operator#8319)
- \[BUGFIX] Relax URL validation in `WebhookConfig` in AlertmanagerConfig CRD to support Go templates. [#8307](prometheus-operator/prometheus-operator#8307) [#8317](prometheus-operator/prometheus-operator#8317)
- \[BUGFIX] Relax URL validation in `RocketChat` receiver in AlertmanagerConfig CRD to support Go templates. [#8318](prometheus-operator/prometheus-operator#8318)
- \[BUGFIX] Relax URL validation in `Pushover` receiver in AlertmanagerConfig CRD to support Go templates. [#8307](prometheus-operator/prometheus-operator#8307) [#8316](prometheus-operator/prometheus-operator#8316)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants