Skip to content

Commit

Permalink
Merge pull request #1699 from mesosphere/mv/event_info
Browse files Browse the repository at this point in the history
Fixes #650. Add deployment plan to DeploymentSuccess/DeploymentFailed.
  • Loading branch information
Peter Kolloch committed Jul 1, 2015
2 parents 98f9a6c + 9d22f8f commit c0e3af1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,14 +293,14 @@ class MarathonSchedulerActor private (

def deploymentSuccess(plan: DeploymentPlan): Unit = {
log.info(s"Deployment of ${plan.target.id} successful")
eventBus.publish(DeploymentSuccess(plan.id))
eventBus.publish(DeploymentSuccess(plan.id, plan))
deploymentRepository.expunge(plan.id)
}

def deploymentFailed(plan: DeploymentPlan, reason: Throwable): Unit = {
log.error(reason, s"Deployment of ${plan.target.id} failed")
plan.affectedApplicationIds.foreach(appId => taskQueue.purge(appId))
eventBus.publish(DeploymentFailed(plan.id))
eventBus.publish(DeploymentFailed(plan.id, plan))
if (reason.isInstanceOf[DeploymentCanceledException])
deploymentRepository.expunge(plan.id)
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/scala/mesosphere/marathon/event/Events.scala
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,13 @@ case class GroupChangeFailed(

case class DeploymentSuccess(
id: String,
plan: DeploymentPlan,
eventType: String = "deployment_success",
timestamp: String = Timestamp.now().toString) extends UpgradeEvent

case class DeploymentFailed(
id: String,
plan: DeploymentPlan,
eventType: String = "deployment_failed",
timestamp: String = Timestamp.now().toString) extends UpgradeEvent

Expand Down

0 comments on commit c0e3af1

Please sign in to comment.