diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-10-26 13:40:52 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-10-26 13:40:52 +0200 |
commit | 99c9925b579cc53ef8c3231f4e6df245c3450764 (patch) | |
tree | 1033300c90ef63de7305dc1dcc30f23dba2ba48e | |
parent | deb47b9814c494ac6ed65b0811207e1e0823b19c (diff) |
Clearer logic
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java index 3c32dcf4c07..6b37c20f2b5 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/deployment/DeploymentTrigger.java @@ -368,9 +368,10 @@ public class DeploymentTrigger { */ public Application triggerAllowParallel(JobType jobType, Application application, boolean first, boolean force, String cause, Lock lock) { + if (jobType == null) return application; // we are passed null when the last job has been reached // Never allow untested changes to go through // Note that this may happen because a new change catches up and prevents an older one from continuing - if ( jobType!= null && ! application.deploymentJobs().isDeployableTo(jobType.environment(), application.deploying())) { + if ( ! application.deploymentJobs().isDeployableTo(jobType.environment(), application.deploying())) { log.warning(String.format("Want to trigger %s for %s with reason %s, but change is untested", jobType, application, cause)); return application; @@ -386,7 +387,6 @@ public class DeploymentTrigger { /** Returns true if the given proposed job triggering should be effected */ private boolean allowedTriggering(JobType jobType, Application application) { - if (jobType == null) return false; // we are passed null when the last job has been reached // Note: We could make a more fine-grained and more correct determination about whether to block // by instead basing the decision on what is currently deployed in the zone. However, // this leads to some additional corner cases, and the possibility of blocking an application |