MCPcopy Create free account
hub / github.com/docker/cli / defaultRestartPolicy

Function defaultRestartPolicy

cli/command/service/opts.go:282–299  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280}
281
282func defaultRestartPolicy() *swarm.RestartPolicy {
283 defaultMaxAttempts := defaults.Service.Task.Restart.MaxAttempts
284 rp := &swarm.RestartPolicy{
285 MaxAttempts: &defaultMaxAttempts,
286 }
287
288 if defaults.Service.Task.Restart.Delay != nil {
289 defaultRestartDelay, _ := gogotypes.DurationFromProto(defaults.Service.Task.Restart.Delay)
290 rp.Delay = &defaultRestartDelay
291 }
292 if defaults.Service.Task.Restart.Window != nil {
293 defaultRestartWindow, _ := gogotypes.DurationFromProto(defaults.Service.Task.Restart.Window)
294 rp.Window = &defaultRestartWindow
295 }
296 rp.Condition = defaultRestartCondition()
297
298 return rp
299}
300
301func defaultRestartCondition() swarm.RestartPolicyCondition {
302 switch defaults.Service.Task.Restart.Condition {

Callers 2

updateServiceFunction · 0.85
ToRestartPolicyMethod · 0.85

Calls 1

defaultRestartConditionFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…