Skip to content

Commit

Permalink
feat: support user_key_file and token_file to the pushover (#5886)
Browse files Browse the repository at this point in the history
* dongjiang, add the user_key_file and token_file keys to the pushover config.

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* add PushoverConfig Sanitize

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* add PushoverConfig Sanitize

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* dongjiang, update by code review

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* fix unittest case

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* update unittest case

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* Update pkg/alertmanager/amcfg_test.go

fix misspell

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update pkg/alertmanager/validation/v1beta1/validation_test.go

fix misspell

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* update code review case

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* add tabale unittest

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* Update pkg/alertmanager/amcfg_test.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update pkg/alertmanager/amcfg_test.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update pkg/alertmanager/amcfg_test.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update pkg/alertmanager/amcfg_test.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update pkg/alertmanager/amcfg_test.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* add unittest case by code review

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

* Update pkg/alertmanager/amcfg_test.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* Update pkg/alertmanager/amcfg_test.go

Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>

* fix golint

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>

---------

Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
Co-authored-by: Arthur Silva Sens <arthursens2005@gmail.com>
  • Loading branch information
dongjiang1989 and ArthurSens committed Oct 6, 2023
1 parent 9745930 commit e3798b0
Show file tree
Hide file tree
Showing 19 changed files with 461 additions and 40 deletions.
72 changes: 68 additions & 4 deletions Documentation/api.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 14 additions & 2 deletions bundle.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions jsonnet/prometheus-operator/alertmanagerconfigs-crd.json
Original file line number Diff line number Diff line change
Expand Up @@ -2279,7 +2279,7 @@
"type": "string"
},
"token": {
"description": "The secret's key that contains the registered application's API token, see https://pushover.net/apps. The secret needs to be in the same namespace as the AlertmanagerConfig object and accessible by the Prometheus Operator.",
"description": "The secret's key that contains the registered application's API token, see https://pushover.net/apps. The secret needs to be in the same namespace as the AlertmanagerConfig object and accessible by the Prometheus Operator. Either `token` or `tokenFile` is required.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
Expand All @@ -2299,6 +2299,10 @@
],
"type": "object"
},
"tokenFile": {
"description": "The token file that contains the registered application's API token, see https://pushover.net/apps. Either `token` or `tokenFile` is required. It requires Alertmanager >= v0.26.0.",
"type": "string"
},
"url": {
"description": "A supplementary URL shown alongside the message.",
"type": "string"
Expand All @@ -2308,7 +2312,7 @@
"type": "string"
},
"userKey": {
"description": "The secret's key that contains the recipient user's user key. The secret needs to be in the same namespace as the AlertmanagerConfig object and accessible by the Prometheus Operator.",
"description": "The secret's key that contains the recipient user's user key. The secret needs to be in the same namespace as the AlertmanagerConfig object and accessible by the Prometheus Operator. Either `userKey` or `userKeyFile` is required.",
"properties": {
"key": {
"description": "The key of the secret to select from. Must be a valid secret key.",
Expand All @@ -2327,6 +2331,10 @@
"key"
],
"type": "object"
},
"userKeyFile": {
"description": "The user key file that contains the recipient user's user key. Either `userKey` or `userKeyFile` is required. It requires Alertmanager >= v0.26.0.",
"type": "string"
}
},
"type": "object"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2139,7 +2139,7 @@
type: 'string',
},
token: {
description: "The secret's key that contains the registered application's API token, see https://pushover.net/apps. The secret needs to be in the same namespace as the AlertmanagerConfig object and accessible by the Prometheus Operator.",
description: "The secret's key that contains the registered application's API token, see https://pushover.net/apps. The secret needs to be in the same namespace as the AlertmanagerConfig object and accessible by the Prometheus Operator. Either `token` or `tokenFile` is required.",
properties: {
key: {
description: 'The key of the secret to select from. Must be a valid secret key.',
Expand All @@ -2158,6 +2158,10 @@
],
type: 'object',
},
tokenFile: {
description: "The token file that contains the registered application's API token, see https://pushover.net/apps. Either `token` or `tokenFile` is required. It requires Alertmanager >= v0.26.0.",
type: 'string',
},
url: {
description: 'A supplementary URL shown alongside the message.',
type: 'string',
Expand All @@ -2167,7 +2171,7 @@
type: 'string',
},
userKey: {
description: "The secret's key that contains the recipient user's user key. The secret needs to be in the same namespace as the AlertmanagerConfig object and accessible by the Prometheus Operator.",
description: "The secret's key that contains the recipient user's user key. The secret needs to be in the same namespace as the AlertmanagerConfig object and accessible by the Prometheus Operator. Either `userKey` or `userKeyFile` is required.",
properties: {
key: {
description: 'The key of the secret to select from. Must be a valid secret key.',
Expand All @@ -2186,6 +2190,10 @@
],
type: 'object',
},
userKeyFile: {
description: "The user key file that contains the recipient user's user key. Either `userKey` or `userKeyFile` is required. It requires Alertmanager >= v0.26.0.",
type: 'string',
},
},
type: 'object',
},
Expand Down

0 comments on commit e3798b0

Please sign in to comment.