diff --git a/front50-migrations/src/main/java/com/netflix/spinnaker/front50/migrations/SpelLoadBalancersMigration.java b/front50-migrations/src/main/java/com/netflix/spinnaker/front50/migrations/SpelLoadBalancersMigration.java index d26171341..2a1531c62 100644 --- a/front50-migrations/src/main/java/com/netflix/spinnaker/front50/migrations/SpelLoadBalancersMigration.java +++ b/front50-migrations/src/main/java/com/netflix/spinnaker/front50/migrations/SpelLoadBalancersMigration.java @@ -2,10 +2,8 @@ import com.netflix.spinnaker.front50.api.model.pipeline.Pipeline; import com.netflix.spinnaker.front50.model.pipeline.PipelineDAO; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Map; +import java.time.Clock; +import java.util.*; import java.util.stream.Collectors; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Component; @@ -13,14 +11,19 @@ @Component @Slf4j public class SpelLoadBalancersMigration implements Migration { + // Only valid until October 13th, 2021 + private static final Date VALID_UNTIL = new GregorianCalendar(2021, 10, 13).getTime(); + private Clock clock = Clock.systemDefaultZone(); + private final PipelineDAO pipelineDAO; public SpelLoadBalancersMigration(PipelineDAO pipelineDAO) { this.pipelineDAO = pipelineDAO; } + @Override public boolean isValid() { - return true; + return clock.instant().toEpochMilli() < VALID_UNTIL.getTime(); } public void run() {