You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by kl...@apache.org on 2023/12/29 06:17:12 UTC
(incubator-devlake) 01/01: fix: trigger bp api should reject disabled bp
This is an automated email from the ASF dual-hosted git repository.
klesh pushed a commit to branch kw-disabled-bp-should-reject-trigger
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git
commit 6a4f1ea35afc34974e9e5e5563eefd3754ca5da7
Author: Klesh Wong <zh...@merico.dev>
AuthorDate: Fri Dec 29 14:16:52 2023 +0800
fix: trigger bp api should reject disabled bp
---
backend/server/services/blueprint.go | 3 +++
1 file changed, 3 insertions(+)
diff --git a/backend/server/services/blueprint.go b/backend/server/services/blueprint.go
index 4dd94b9f6..fa2850895 100644
--- a/backend/server/services/blueprint.go
+++ b/backend/server/services/blueprint.go
@@ -406,6 +406,9 @@ func TriggerBlueprint(id uint64, syncPolicy *models.SyncPolicy, shouldSanitize b
logger.Error(err, "GetBlueprint, id: %d", id)
return nil, err
}
+ if !blueprint.Enable {
+ return nil, errors.BadInput.New("blueprint is not enabled")
+ }
blueprint.SkipCollectors = syncPolicy.SkipCollectors
blueprint.FullSync = syncPolicy.FullSync
pipeline, err := createPipelineByBlueprint(blueprint, syncPolicy)