From 45d3a2cc0b188f9a383b63eb66aa8b559196a6ca Mon Sep 17 00:00:00 2001 From: anotherchrisberry Date: Fri, 12 Aug 2016 15:42:47 -0700 Subject: [PATCH] do not fire triggers if pipeline is disabled --- .../main/java/com/netflix/spinnaker/echo/model/Pipeline.java | 3 +++ .../echo/pipelinetriggers/monitor/TriggerMonitor.java | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/echo-model/src/main/java/com/netflix/spinnaker/echo/model/Pipeline.java b/echo-model/src/main/java/com/netflix/spinnaker/echo/model/Pipeline.java index 3f56983be..a55a1f1b6 100644 --- a/echo-model/src/main/java/com/netflix/spinnaker/echo/model/Pipeline.java +++ b/echo-model/src/main/java/com/netflix/spinnaker/echo/model/Pipeline.java @@ -45,6 +45,9 @@ @JsonProperty boolean parallel; + @JsonProperty + boolean disabled; + @JsonProperty boolean limitConcurrent; diff --git a/echo-pipelinetriggers/src/main/java/com/netflix/spinnaker/echo/pipelinetriggers/monitor/TriggerMonitor.java b/echo-pipelinetriggers/src/main/java/com/netflix/spinnaker/echo/pipelinetriggers/monitor/TriggerMonitor.java index dcce8a383..543a0c060 100644 --- a/echo-pipelinetriggers/src/main/java/com/netflix/spinnaker/echo/pipelinetriggers/monitor/TriggerMonitor.java +++ b/echo-pipelinetriggers/src/main/java/com/netflix/spinnaker/echo/pipelinetriggers/monitor/TriggerMonitor.java @@ -90,7 +90,7 @@ protected Action1 triggerEachMatchFrom(final List pipeli protected Func1> withMatchingTrigger(final TriggerEvent event) { val triggerPredicate = matchTriggerFor(event); return pipeline -> { - if (pipeline.getTriggers() == null) { + if (pipeline.getTriggers() == null || pipeline.isDisabled()) { return Optional.empty(); } else { return pipeline.getTriggers()