mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
api/types/swarm: define type for FailureAction
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -106,14 +106,19 @@ type ReplicatedJob struct {
|
||||
// This type is deliberately empty.
|
||||
type GlobalJob struct{}
|
||||
|
||||
// FailureAction is the action to perform when updating a service fails.
|
||||
type FailureAction string
|
||||
|
||||
const (
|
||||
// UpdateFailureActionPause PAUSE
|
||||
UpdateFailureActionPause = "pause"
|
||||
UpdateFailureActionPause FailureAction = "pause"
|
||||
// UpdateFailureActionContinue CONTINUE
|
||||
UpdateFailureActionContinue = "continue"
|
||||
UpdateFailureActionContinue FailureAction = "continue"
|
||||
// UpdateFailureActionRollback ROLLBACK
|
||||
UpdateFailureActionRollback = "rollback"
|
||||
UpdateFailureActionRollback FailureAction = "rollback"
|
||||
)
|
||||
|
||||
const (
|
||||
// UpdateOrderStopFirst STOP_FIRST
|
||||
UpdateOrderStopFirst = "stop-first"
|
||||
// UpdateOrderStartFirst START_FIRST
|
||||
@@ -130,7 +135,7 @@ type UpdateConfig struct {
|
||||
Delay time.Duration `json:",omitempty"`
|
||||
|
||||
// FailureAction is the action to take when an update failures.
|
||||
FailureAction string `json:",omitempty"`
|
||||
FailureAction FailureAction `json:",omitempty"`
|
||||
|
||||
// Monitor indicates how long to monitor a task for failure after it is
|
||||
// created. If the task fails by ending up in one of the states
|
||||
|
||||
@@ -705,7 +705,7 @@ func setImage(image string) testdaemon.ServiceConstructor {
|
||||
}
|
||||
}
|
||||
|
||||
func setFailureAction(failureAction string) testdaemon.ServiceConstructor {
|
||||
func setFailureAction(failureAction swarm.FailureAction) testdaemon.ServiceConstructor {
|
||||
return func(s *swarm.Service) {
|
||||
s.Spec.UpdateConfig.FailureAction = failureAction
|
||||
}
|
||||
|
||||
13
vendor/github.com/moby/moby/api/types/swarm/service.go
generated
vendored
13
vendor/github.com/moby/moby/api/types/swarm/service.go
generated
vendored
@@ -106,14 +106,19 @@ type ReplicatedJob struct {
|
||||
// This type is deliberately empty.
|
||||
type GlobalJob struct{}
|
||||
|
||||
// FailureAction is the action to perform when updating a service fails.
|
||||
type FailureAction string
|
||||
|
||||
const (
|
||||
// UpdateFailureActionPause PAUSE
|
||||
UpdateFailureActionPause = "pause"
|
||||
UpdateFailureActionPause FailureAction = "pause"
|
||||
// UpdateFailureActionContinue CONTINUE
|
||||
UpdateFailureActionContinue = "continue"
|
||||
UpdateFailureActionContinue FailureAction = "continue"
|
||||
// UpdateFailureActionRollback ROLLBACK
|
||||
UpdateFailureActionRollback = "rollback"
|
||||
UpdateFailureActionRollback FailureAction = "rollback"
|
||||
)
|
||||
|
||||
const (
|
||||
// UpdateOrderStopFirst STOP_FIRST
|
||||
UpdateOrderStopFirst = "stop-first"
|
||||
// UpdateOrderStartFirst START_FIRST
|
||||
@@ -130,7 +135,7 @@ type UpdateConfig struct {
|
||||
Delay time.Duration `json:",omitempty"`
|
||||
|
||||
// FailureAction is the action to take when an update failures.
|
||||
FailureAction string `json:",omitempty"`
|
||||
FailureAction FailureAction `json:",omitempty"`
|
||||
|
||||
// Monitor indicates how long to monitor a task for failure after it is
|
||||
// created. If the task fails by ending up in one of the states
|
||||
|
||||
Reference in New Issue
Block a user