Skip to content

Commit

Permalink
fix(core): don't kill pipelines running on v3
Browse files Browse the repository at this point in the history
  • Loading branch information
robfletcher committed May 1, 2017
1 parent 97960f3 commit 4bd8587
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import rx.Observable;
import static com.netflix.spinnaker.orca.ExecutionStatus.CANCELED;
import static com.netflix.spinnaker.orca.ExecutionStatus.RUNNING;
import static com.netflix.spinnaker.orca.pipeline.model.Execution.ExecutionEngine.v2;
import static java.lang.String.format;
import static java.time.Clock.systemDefaultZone;
import static java.time.format.DateTimeFormatter.ISO_LOCAL_DATE_TIME;
Expand All @@ -42,6 +43,7 @@
@Component
@ConditionalOnExpression("${pollers.zombiePipeline.enabled:true}")
@Slf4j
@Deprecated
public class ZombiePipelineCleanupAgent {

/**
Expand Down Expand Up @@ -108,6 +110,7 @@ private Observable<Pipeline> findZombies() {
return repository
.retrievePipelines()
.filter(this::isIncomplete)
.filter(this::isV2)
.filter(this::isRunningOnZombieInstance)
.doOnCompleted(() -> log.info("Zombie pipeline sweep completed."));
}
Expand Down Expand Up @@ -148,4 +151,8 @@ private boolean isRunningOnZombieInstance(Pipeline pipeline) {
private boolean isIncomplete(Pipeline pipeline) {
return !pipeline.getStatus().isComplete();
}

private boolean isV2(Pipeline pipeline) {
return pipeline.getExecutionEngine() == v2;
}
}

0 comments on commit 4bd8587

Please sign in to comment.