diff --git a/kube_notify/mattermost.py b/kube_notify/mattermost.py index 303e522..b769888 100644 --- a/kube_notify/mattermost.py +++ b/kube_notify/mattermost.py @@ -6,7 +6,7 @@ def send_mattermost_message( - url: str, + webhook: str, title: str, description: str, fields: dict, @@ -25,6 +25,6 @@ def send_mattermost_message( channel and data.update({"channel": channel}) username and data.update({"username": username}) icon_url and data.update({"icon_url": icon_url}) - response = requests.post(url, headers=headers, data=json.dumps(data)) + response = requests.post(webhook, headers=headers, data=json.dumps(data)) if response.status_code != 200: logger.logger.error("Failed to send notification to Mattermost") diff --git a/kube_notify/notifications.py b/kube_notify/notifications.py index 3706e8e..b7aa80a 100644 --- a/kube_notify/notifications.py +++ b/kube_notify/notifications.py @@ -76,7 +76,7 @@ async def handle_notify( if group_values := group.get("mattermost"): notifs.append(f"{group_name}/mattermost") mattermost.send_mattermost_message( - group_values["url"], + group_values["webhook"], title, description, fields,