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

Method rollbackConfig

cli/command/service/opts.go:202–229  ·  view source on GitHub ↗
(flags *pflag.FlagSet)

Source from the content-addressed store, hash-verified

200}
201
202func (o updateOptions) rollbackConfig(flags *pflag.FlagSet) *swarm.UpdateConfig {
203 if !anyChanged(flags, flagRollbackParallelism, flagRollbackDelay, flagRollbackMonitor, flagRollbackFailureAction, flagRollbackMaxFailureRatio, flagRollbackOrder) {
204 return nil
205 }
206
207 updateConfig := updateConfigFromDefaults(defaults.Service.Rollback)
208
209 if flags.Changed(flagRollbackParallelism) {
210 updateConfig.Parallelism = o.parallelism
211 }
212 if flags.Changed(flagRollbackDelay) {
213 updateConfig.Delay = o.delay
214 }
215 if flags.Changed(flagRollbackMonitor) {
216 updateConfig.Monitor = o.monitor
217 }
218 if flags.Changed(flagRollbackFailureAction) {
219 updateConfig.FailureAction = swarm.FailureAction(o.onFailure)
220 }
221 if flags.Changed(flagRollbackMaxFailureRatio) {
222 updateConfig.MaxFailureRatio = o.maxFailureRatio.Value()
223 }
224 if flags.Changed(flagRollbackOrder) {
225 updateConfig.Order = swarm.UpdateOrder(o.order)
226 }
227
228 return updateConfig
229}
230
231type resourceOptions struct {
232 limitCPU opts.NanoCPUs

Callers 1

ToServiceMethod · 0.80

Calls 4

anyChangedFunction · 0.85
updateConfigFromDefaultsFunction · 0.85
UpdateOrderMethod · 0.80
ValueMethod · 0.65

Tested by

no test coverage detected