diff options
author | Jon Marius Venstad <venstad@gmail.com> | 2022-01-10 11:05:55 +0100 |
---|---|---|
committer | Jon Marius Venstad <venstad@gmail.com> | 2022-01-10 11:05:55 +0100 |
commit | 935ec83e3a00cdb21bc9d089c60b5a9edaed1332 (patch) | |
tree | 22f8df9653b1b0eaa1374fd48a7b557979db0f20 /controller-server | |
parent | d196326a38205db71e4107b0147d15303d3d208a (diff) |
Ignore apps without any jobs in deployment API
Diffstat (limited to 'controller-server')
2 files changed, 10 insertions, 2 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiHandler.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiHandler.java index f18229b4377..24117b9f55f 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiHandler.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiHandler.java @@ -94,7 +94,10 @@ public class DeploymentApiHandler extends LoggingRequestHandler { Cursor platformArray = root.setArray("versions"); var versionStatus = controller.readVersionStatus(); var systemVersion = controller.systemVersion(versionStatus); - var deploymentStatuses = controller.jobController().deploymentStatuses(ApplicationList.from(controller.applications().asList()), systemVersion); + ApplicationList applications = ApplicationList.from(controller.applications().asList()) + .matching(application -> application.deploymentSpec().steps().stream() + .anyMatch(step -> ! step.zones().isEmpty())); + var deploymentStatuses = controller.jobController().deploymentStatuses(applications, systemVersion); var deploymentStatistics = DeploymentStatistics.compute(versionStatus.versions().stream().map(VespaVersion::versionNumber).collect(toList()), deploymentStatuses) .stream().collect(toMap(DeploymentStatistics::version, identity())); diff --git a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java index d538728f7da..61aab87532f 100644 --- a/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java +++ b/controller-server/src/test/java/com/yahoo/vespa/hosted/controller/restapi/deployment/DeploymentApiTest.java @@ -42,12 +42,14 @@ public class DeploymentApiTest extends ControllerContainerTest { ApplicationPackage applicationPackage = new ApplicationPackageBuilder() .region("us-west-1") .build(); + ApplicationPackage emptyPackage = new ApplicationPackageBuilder().instances("custom").build(); - // 3 applications deploy on current system version + // 3 applications deploy on current system version, 1 is empty var failingApp = deploymentTester.newDeploymentContext("tenant1", "application1", "default"); var productionApp = deploymentTester.newDeploymentContext("tenant2", "application2", "i1"); var otherProductionApp = deploymentTester.newDeploymentContext("tenant2", "application2", "i2"); var appWithoutDeployments = deploymentTester.newDeploymentContext("tenant3", "application3", "default"); + var otherAppWithoutDeployment = deploymentTester.newDeploymentContext("tenant4", "application4", "custom"); failingApp.submit(applicationPackage).deploy(); productionApp.submit(multiInstancePackage).runJob(JobType.systemTest).runJob(JobType.stagingTest).runJob(JobType.productionUsWest1); otherProductionApp.runJob(JobType.productionUsWest1); @@ -56,6 +58,9 @@ public class DeploymentApiTest extends ControllerContainerTest { appWithoutDeployments.submit(applicationPackage).deploy(); appWithoutDeployments.submit(new ApplicationPackageBuilder().allow(ValidationId.deploymentRemoval).build()); + // Deploy application without any declared jobs. + otherAppWithoutDeployment.submit(emptyPackage); + // New version released version = Version.fromString("5.1"); deploymentTester.controllerTester().upgradeSystem(version); |