mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-17 13:11:23 +01:00
Merge pull request #11276 from mmpei/offical-webhook-slack-fix
fix webhook slack test error
This commit is contained in:
commit
2783fd0950
@ -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