Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for feishu #124

Merged
merged 2 commits into from
Mar 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
248 changes: 240 additions & 8 deletions config/bundle.yaml

Large diffs are not rendered by default.

66 changes: 66 additions & 0 deletions config/crd/bases/notification.kubesphere.io_configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,72 @@ spec:
- from
- smartHost
type: object
feishu:
description: FeishuConfig is the configuration of feishu application
properties:
appID:
description: The id of the application with which to send messages.
properties:
value:
type: string
valueFrom:
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: Name of the secret.
type: string
namespace:
description: The namespace of the secret, default
to the `defaultSecretNamespace` of `NotificationManager`
crd. If the `defaultSecretNamespace` does not set,
default to the pod's namespace.
type: string
required:
- key
- name
type: object
type: object
type: object
appSecret:
description: The key in the secret to be used. Must be a valid
secret key.
properties:
value:
type: string
valueFrom:
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: Name of the secret.
type: string
namespace:
description: The namespace of the secret, default
to the `defaultSecretNamespace` of `NotificationManager`
crd. If the `defaultSecretNamespace` does not set,
default to the pod's namespace.
type: string
required:
- key
- name
type: object
type: object
type: object
required:
- appID
- appSecret
type: object
pushover:
properties:
labels:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3262,9 +3262,8 @@ spec:
- namespace
type: object
template:
description: The name of the template to generate DingTalk
message. If the global template is not set, it will use
default.
description: The name of the template to generate notification.
If the global template is not set, it will use default.
type: string
tmplText:
description: Template file.
Expand Down Expand Up @@ -3527,6 +3526,26 @@ spec:
is html'
type: string
type: object
feishu:
properties:
notificationTimeout:
description: Notification Sending Timeout
format: int32
type: integer
template:
description: The name of the template to generate DingTalk
message. If the global template is not set, it will
use default.
type: string
tmplType:
description: 'template type: text or post, default type
is post'
type: string
tokenExpires:
description: The time of token expired.
format: int64
type: integer
type: object
global:
properties:
cluster:
Expand Down
217 changes: 210 additions & 7 deletions config/crd/bases/notification.kubesphere.io_receivers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ spec:
description: whether the receiver is enabled
type: boolean
template:
description: The name of the template to generate DingTalk message.
description: The name of the template to generate notification.
If the global template is not set, it will use default.
type: string
titleTemplate:
Expand Down Expand Up @@ -1121,7 +1121,7 @@ spec:
description: The name of the template to generate email subject
type: string
template:
description: The name of the template to generate DingTalk message.
description: The name of the template to generate notification.
If the global template is not set, it will use default.
type: string
tmplText:
Expand Down Expand Up @@ -1154,6 +1154,209 @@ spec:
required:
- to
type: object
feishu:
properties:
alertSelector:
description: Selector to filter alerts.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If
the operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced
during a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A
single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is "key",
the operator is "In", and the values array contains only
"value". The requirements are ANDed.
type: object
type: object
chatbot:
description: FeishuChatBot is the configuration of ChatBot
properties:
keywords:
description: Custom keywords of ChatBot
items:
type: string
type: array
secret:
description: Secret of ChatBot, you can get it after enabling
signature verification of ChatBot.
properties:
value:
type: string
valueFrom:
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's
namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: Name of the secret.
type: string
namespace:
description: The namespace of the secret, default
to the `defaultSecretNamespace` of `NotificationManager`
crd. If the `defaultSecretNamespace` does not
set, default to the pod's namespace.
type: string
required:
- key
- name
type: object
type: object
type: object
webhook:
description: The webhook of the ChatBot to which the message
will be sent.
properties:
value:
type: string
valueFrom:
properties:
secretKeyRef:
description: Selects a key of a secret in the pod's
namespace
properties:
key:
description: The key of the secret to select from. Must
be a valid secret key.
type: string
name:
description: Name of the secret.
type: string
namespace:
description: The namespace of the secret, default
to the `defaultSecretNamespace` of `NotificationManager`
crd. If the `defaultSecretNamespace` does not
set, default to the pod's namespace.
type: string
required:
- key
- name
type: object
type: object
type: object
required:
- webhook
type: object
department:
items:
type: string
maxItems: 200
type: array
enabled:
description: whether the receiver is enabled
type: boolean
feishuConfigSelector:
description: FeishuConfig to be selected for this receiver
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that relates
the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In, NotIn,
Exists and DoesNotExist.
type: string
values:
description: values is an array of string values. If
the operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. This array is replaced
during a strategic merge patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs. A
single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field is "key",
the operator is "In", and the values array contains only
"value". The requirements are ANDed.
type: object
type: object
template:
description: The name of the template to generate notification.
If the global template is not set, it will use default.
type: string
tmplText:
description: Template file.
properties:
key:
description: The key of the configmap to select from. Must
be a valid configmap key.
type: string
name:
description: Name of the configmap.
type: string
namespace:
description: The namespace of the configmap, default to the
`defaultSecretNamespace` of `NotificationManager` crd. If
the `defaultSecretNamespace` does not set, default to the
pod's namespace.
type: string
required:
- name
type: object
tmplType:
description: 'template type: text or post, default type is post'
type: string
user:
items:
type: string
maxItems: 200
type: array
type: object
pushover:
properties:
alertSelector:
Expand Down Expand Up @@ -1298,7 +1501,7 @@ spec:
type: object
type: object
template:
description: The name of the template to generate DingTalk message.
description: The name of the template to generate notification.
If the global template is not set, it will use default.
type: string
tmplText:
Expand Down Expand Up @@ -1422,7 +1625,7 @@ spec:
type: object
type: object
template:
description: The name of the template to generate DingTalk message.
description: The name of the template to generate notification.
If the global template is not set, it will use default.
type: string
tmplText:
Expand Down Expand Up @@ -1546,7 +1749,7 @@ spec:
type: object
type: object
template:
description: The name of the template to generate Sms message.
description: The name of the template to generate notification.
If the global template is not set, it will use default.
type: string
tmplText:
Expand Down Expand Up @@ -1838,7 +2041,7 @@ spec:
- namespace
type: object
template:
description: The name of the template to generate DingTalk message.
description: The name of the template to generate notification.
If the global template is not set, it will use default.
type: string
tmplText:
Expand Down Expand Up @@ -1975,7 +2178,7 @@ spec:
description: whether the receiver is enabled
type: boolean
template:
description: The name of the template to generate DingTalk message.
description: The name of the template to generate notification.
If the global template is not set, it will use default.
type: string
tmplText:
Expand Down
Loading