Check for empty deployment spec on submissions
@@ -6,6 +6,7 @@ import com.google.common.base.Joiner;
import com.google.common.collect.ImmutableSet;
import com.google.inject.Inject;
import com.yahoo.component.Version;
+import com.yahoo.config.application.api.DeploymentSpec;
import com.yahoo.config.provision.ApplicationId;
import com.yahoo.config.provision.Environment;
import com.yahoo.config.provision.InstanceName;
@@ -1654,6 +1655,9 @@ public class ApplicationApiHandler extends LoggingRequestHandler {
long projectId = Math.max(1, submitOptions.field("projectId").asLong());
ApplicationPackage applicationPackage = new ApplicationPackage(dataParts.get(EnvironmentResource.APPLICATION_ZIP));
+ if (DeploymentSpec.empty.equals(applicationPackage.deploymentSpec()))
+ throw new IllegalArgumentException("Missing required file 'deployment.xml'");
+
controller.applications().verifyApplicationIdentityConfiguration(TenantName.from(tenant),
applicationPackage,
Optional.of(requireUserPrincipal(request)));
