migrates all remaining pipelines to v2
package com.netflix.spinnaker.front50.migrations;
-import java.util.List;
-import java.util.Map;
import com.netflix.spinnaker.front50.model.pipeline.Pipeline;
import com.netflix.spinnaker.front50.model.pipeline.PipelineDAO;
import org.slf4j.Logger;
@@ -43,8 +41,6 @@ public class ExecutionEngineMigration implements Migration {
Observable
.from(pipelineDAO.all())
.filter(this::isV1)
- .filter(this::hasNoDeployStage)
- .filter(this::hasNoCanaryStage)
.subscribe(this::migrate, this::onError);
}
@@ -52,22 +48,6 @@ public class ExecutionEngineMigration implements Migration {
return !"v2".equals(pipeline.get("executionEngine"));
}
- private boolean hasNoDeployStage(Pipeline pipeline) {
- return !Observable
- .from((List<Map<String, Object>>) pipeline.get("stages"))
- .exists(stage -> "deploy".equals(stage.get("type")))
- .toBlocking()
- .first();
- }
-
- private boolean hasNoCanaryStage(Pipeline pipeline) {
- return !Observable
- .from((List<Map<String, Object>>) pipeline.get("stages"))
- .exists(stage -> "canary".equals(stage.get("type")))
- .toBlocking()
- .first();
- }
-
private void migrate(Pipeline pipeline) {
log.info("Migrating {} pipeline '{}' from v1 -> v2", pipeline.getApplication(), pipeline.getName());
