mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-18 14:47:38 +01:00
fix webhook slack test error
Signed-off-by: peimingming <peimingming@corp.netease.com>
This commit is contained in:
parent
2c3552904d
commit
5924658092
@ -9,6 +9,7 @@ import (
|
|||||||
commonhttp "github.com/goharbor/harbor/src/common/http"
|
commonhttp "github.com/goharbor/harbor/src/common/http"
|
||||||
"github.com/goharbor/harbor/src/common/models"
|
"github.com/goharbor/harbor/src/common/models"
|
||||||
"github.com/goharbor/harbor/src/lib/log"
|
"github.com/goharbor/harbor/src/lib/log"
|
||||||
|
"github.com/goharbor/harbor/src/pkg/notifier/model"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultManager ...
|
// DefaultManager ...
|
||||||
@ -94,7 +95,7 @@ func (m *DefaultManager) Delete(policyID int64) error {
|
|||||||
func (m *DefaultManager) Test(policy *models.NotificationPolicy) error {
|
func (m *DefaultManager) Test(policy *models.NotificationPolicy) error {
|
||||||
for _, target := range policy.Targets {
|
for _, target := range policy.Targets {
|
||||||
switch target.Type {
|
switch target.Type {
|
||||||
case "http":
|
case model.NotifyTypeHTTP, model.NotifyTypeSlack:
|
||||||
return m.policyHTTPTest(target.Address, target.SkipCertVerify)
|
return m.policyHTTPTest(target.Address, target.SkipCertVerify)
|
||||||
default:
|
default:
|
||||||
return fmt.Errorf("invalid policy target type: %s", target.Type)
|
return fmt.Errorf("invalid policy target type: %s", target.Type)
|
||||||
|
Loading…
Reference in New Issue
Block a user