Closed MrLichangming closed 1 year ago
我尝试使用自定义body,发送到webhook,接收到的消息体,message字段json格式错误
configmap文件: apiVersion: v1 data: content: >- {"EventType": "{{ .Type }}","EventKind": "{{ .InvolvedObject.Kind }}","EventReason": "{{ .Reason }}","EventTime": "{{ .LastTimestamp }}","EventMessage": "{{ .Message }}"} kind: ConfigMap metadata: name: custom-webhook-body namespace: kube-system
apiVersion: v1 data: content: >- {"EventType": "{{ .Type }}","EventKind": "{{ .InvolvedObject.Kind }}","EventReason": "{{ .Reason }}","EventTime": "{{ .LastTimestamp }}","EventMessage": "{{ .Message }}"} kind: ConfigMap metadata: name: custom-webhook-body namespace: kube-system
发送到webhook的配置
问题
{"EventType": "Normal","EventKind": "Pod","EventReason": "BackOff","EventTime": "2022-03-08 11:15:47 +0800 CST","EventMessage": 'Back-off pulling image "hub.wusong.com/dev/infrastructure/qiwei:test-5"'}
你是指 EventType 应该为 Warning 还是什么呢?
我尝试使用自定义body,发送到webhook,接收到的消息体,message字段json格式错误
configmap文件:
apiVersion: v1 data: content: >- {"EventType": "{{ .Type }}","EventKind": "{{ .InvolvedObject.Kind }}","EventReason": "{{ .Reason }}","EventTime": "{{ .LastTimestamp }}","EventMessage": "{{ .Message }}"} kind: ConfigMap metadata: name: custom-webhook-body namespace: kube-system
发送到webhook的配置
问题
{"EventType": "Normal","EventKind": "Pod","EventReason": "BackOff","EventTime": "2022-03-08 11:15:47 +0800 CST","EventMessage": 'Back-off pulling image "hub.wusong.com/dev/infrastructure/qiwei:test-5"'}