mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-18 00:05:12 +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"
|
||||
"github.com/goharbor/harbor/src/common/models"
|
||||
"github.com/goharbor/harbor/src/lib/log"
|
||||
"github.com/goharbor/harbor/src/pkg/notifier/model"
|
||||
)
|
||||
|
||||
// DefaultManager ...
|
||||
@ -94,7 +95,7 @@ func (m *DefaultManager) Delete(policyID int64) error {
|
||||
func (m *DefaultManager) Test(policy *models.NotificationPolicy) error {
|
||||
for _, target := range policy.Targets {
|
||||
switch target.Type {
|
||||
case "http":
|
||||
case model.NotifyTypeHTTP, model.NotifyTypeSlack:
|
||||
return m.policyHTTPTest(target.Address, target.SkipCertVerify)
|
||||
default:
|
||||
return fmt.Errorf("invalid policy target type: %s", target.Type)
|
||||
|
Loading…
Reference in New Issue
Block a user