open-nomad/nomad/deploymentwatcher/multiregion_oss.go
Tim Gross c14a75bfab multiregion: use pending instead of paused
The `paused` state is used as an operator safety mechanism, so that they can
debug a deployment or halt one that's causing a wider failure. By using the
`paused` state as the first state of a multiregion deployment, we risked
resuming an intentionally operator-paused deployment because of activity in a
peer region.

This changeset replaces the use of the `paused` state with a `pending` state,
and provides a `Deployment.Run` internal RPC to replace the use of the
`Deployment.Pause` (resume) RPC we were using in `deploymentwatcher`.
2020-06-17 11:06:14 -04:00

34 lines
1.2 KiB
Go

// +build !ent
package deploymentwatcher
import "github.com/hashicorp/nomad/nomad/structs"
// DeploymentRPC and JobRPC hold methods for interacting with peer regions
// in enterprise edition.
type DeploymentRPC interface{}
type JobRPC interface{}
func (w *deploymentWatcher) nextRegion(status string) error {
return nil
}
// RunDeployment is used to run a pending multiregion deployment. In
// single-region deployments, the pending state is unused.
func (w *deploymentWatcher) RunDeployment(req *structs.DeploymentRunRequest, resp *structs.DeploymentUpdateResponse) error {
return nil
}
// UnblockDeployment is used to unblock a multiregion deployment. In
// single-region deployments, the blocked state is unused.
func (w *deploymentWatcher) UnblockDeployment(req *structs.DeploymentUnblockRequest, resp *structs.DeploymentUpdateResponse) error {
return nil
}
// CancelDeployment is used to cancel a multiregion deployment. In
// single-region deployments, the deploymentwatcher has sole responsibility to
// cancel deployments so this RPC is never used.
func (w *deploymentWatcher) CancelDeployment(req *structs.DeploymentCancelRequest, resp *structs.DeploymentUpdateResponse) error {
return nil
}