func canBeLost(status *api.UnitStatus) bool { // Pending and Installing are deprecated. // Need to still check pending for existing deployments. switch status.UnitAgent.Status { case params.StatusPending, params.StatusInstalling, params.StatusAllocating: return false case params.StatusExecuting: return status.UnitAgent.Info != operation.RunningHookMessage(string(hooks.Install)) } // TODO(wallyworld) - use status history to see if start hook has run. isInstalled := status.Workload.Status != params.StatusMaintenance || status.Workload.Info != state.MessageInstalling return isInstalled }
func canBeLost(status *params.UnitStatus) bool { switch status.UnitAgent.Status { case params.StatusAllocating: return false case params.StatusExecuting: return status.UnitAgent.Info != operation.RunningHookMessage(string(hooks.Install)) } // TODO(fwereade/wallyworld): we should have an explicit place in the model // to tell us when we've hit this point, instead of piggybacking on top of // status and/or status history. isInstalled := status.Workload.Status != params.StatusMaintenance || status.Workload.Info != state.MessageInstalling return isInstalled }
func canBeLost(agent, workload status.StatusInfo) bool { switch agent.Status { case status.Allocating: return false case status.Executing: return agent.Message != operation.RunningHookMessage(string(hooks.Install)) } // TODO(fwereade/wallyworld): we should have an explicit place in the model // to tell us when we've hit this point, instead of piggybacking on top of // status and/or status history. return isWorkloadInstalled(workload) }