diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-08-30 13:27:07 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2017-08-30 13:27:07 +0200 |
commit | 2b06022f3ebc63bd211961c83307bbf4f4c286cb (patch) | |
tree | 7c67c36b494c5dd6cd5598e5749fe9c3d8836e62 /controller-server | |
parent | 6c5dc8f0bdabeec182ee4ebe566080f8a7ff072f (diff) |
Nonfunctional changes
Diffstat (limited to 'controller-server')
2 files changed, 12 insertions, 12 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java index 3ede73963a3..1e5598f264a 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/ApplicationController.java @@ -227,22 +227,21 @@ public class ApplicationController { // Ensure that the deploying change is tested // FIXME: For now only for non-self-triggering applications - VESPA-8418 - if (!application.deploymentJobs().isSelfTriggering() && !zone.environment().isManuallyDeployed() && !application.deploymentJobs().isDeployableTo(zone.environment(), application.deploying())) { + if ( ! application.deploymentJobs().isSelfTriggering() && !zone.environment().isManuallyDeployed() && + ! application.deploymentJobs().isDeployableTo(zone.environment(), application.deploying())) { throw new IllegalArgumentException("Rejecting deployment of " + application + " to " + zone + - " as pending " + application.deploying().get() + - " is untested"); + " as pending " + application.deploying().get() + " is untested"); } - // Don't update/store applicationpackage information when deploying previous application package (initial staging step) - if(! options.deployCurrentVersion) { - // Add missing information to application + if( ! options.deployCurrentVersion) { + // Add missing information to application (unless we're deplying the previous version (initial staging step) application = application.with(applicationPackage.deploymentSpec()); application = application.with(applicationPackage.validationOverrides()); if (options.screwdriverBuildJob.isPresent() && options.screwdriverBuildJob.get().screwdriverId != null) application = application.withProjectId(options.screwdriverBuildJob.get().screwdriverId.value()); if (application.deploying().isPresent() && application.deploying().get() instanceof Change.ApplicationChange) application = application.withDeploying(Optional.of(Change.ApplicationChange.of(revision))); - if (!triggeredWith(revision, application, jobType) && !zone.environment().isManuallyDeployed() && jobType != null) { + if ( ! triggeredWith(revision, application, jobType) && !zone.environment().isManuallyDeployed() && jobType != null) { // Triggering information is used to store which changes were made or attempted // - For self-triggered applications we don't have any trigger information, so we add it here. // - For all applications, we don't have complete control over which revision is actually built, @@ -480,8 +479,7 @@ public class ApplicationController { public Application deactivate(Application application, Deployment deployment, boolean requireThatDeploymentHasExpired) { try (Lock lock = lock(application.id())) { - // TODO: ignore no application errors for config server client, - // only return such errors from sherpa client. + // TODO: ignore no application errors for config server client, only return such errors from sherpa client. if (requireThatDeploymentHasExpired && ! DeploymentExpirer.hasExpired(controller.zoneRegistry(), deployment, clock.instant())) return application; diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/Upgrader.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/Upgrader.java index b3d75106d2f..22d0a56c367 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/Upgrader.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/maintenance/Upgrader.java @@ -47,9 +47,11 @@ public class Upgrader extends Maintainer { switch (target.confidence()) { case broken: - log.info(String.format("Version %s is broken, cancelling all upgrades", target.versionNumber())); - cancelUpgradesOf(applications().upgradingTo(target.versionNumber()) - .without(UpgradePolicy.canary)); // keep trying canaries + ApplicationList toCancel = applications().upgradingTo(target.versionNumber()) + .without(UpgradePolicy.canary); + if (toCancel.isEmpty()) break; + log.info("Version " + target.versionNumber() + " is broken, cancelling all upgrades"); + cancelUpgradesOf(toCancel); break; case low: upgrade(applications().with(UpgradePolicy.canary), target.versionNumber()); |