Skip to content

Nothing sent via generic webhook to google-chat #65

Description

@lgraziosi

Hello, I'm trying to use kubewatch to send everything to a google-chat webhook.
I configured everything, and the test seems fine:

root@kubewatch-64577c4cc7-v5thc:/# kubewatch config test
INFO[0000] Custom log formatter: json                   
INFO[0000] Setting custom log formatter to: json        
Testing Handler configs from .kubewatch.yaml
{"level":"info","msg":"No webhook cert is given","time":"2024-01-26T11:42:54Z"}
{"level":"info","msg":"Message successfully sent to https://chat.googleapis.com/v1/spaces/CENSORED at 2024-01-26 11:42:54.488587515 +0000 UTC m=+0.251134753 ","time":"2024-01-26T11:42:54Z"}

But nothing is actually received in the group chat mentioned.
As a reference, something simple as this in python actually sends the message:

from httplib2 import Http
from json import dumps
import sys

def main():
    url = 'https://chat.googleapis.com/v1/spaces/CENSORED'
    bot_message = {
        'text' : sys.argv[1]}

    message_headers = { 'Content-Type': 'application/json; charset=UTF-8'}

    http_obj = Http()

    response = http_obj.request(
        uri=url,
        method='POST',
        headers=message_headers,
        body=dumps(bot_message),
    )

    print(response)

if __name__ == '__main__':
    main()

What could be the issue? Am I missing something?
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions