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

Method updateConfig

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

Source from the content-addressed store, hash-verified

171}
172
173func (o updateOptions) updateConfig(flags *pflag.FlagSet) *swarm.UpdateConfig {
174 if !anyChanged(flags, flagUpdateParallelism, flagUpdateDelay, flagUpdateMonitor, flagUpdateFailureAction, flagUpdateMaxFailureRatio, flagUpdateOrder) {
175 return nil
176 }
177
178 updateConfig := updateConfigFromDefaults(defaults.Service.Update)
179
180 if flags.Changed(flagUpdateParallelism) {
181 updateConfig.Parallelism = o.parallelism
182 }
183 if flags.Changed(flagUpdateDelay) {
184 updateConfig.Delay = o.delay
185 }
186 if flags.Changed(flagUpdateMonitor) {
187 updateConfig.Monitor = o.monitor
188 }
189 if flags.Changed(flagUpdateFailureAction) {
190 updateConfig.FailureAction = swarm.FailureAction(o.onFailure)
191 }
192 if flags.Changed(flagUpdateMaxFailureRatio) {
193 updateConfig.MaxFailureRatio = o.maxFailureRatio.Value()
194 }
195 if flags.Changed(flagUpdateOrder) {
196 updateConfig.Order = swarm.UpdateOrder(o.order)
197 }
198
199 return updateConfig
200}
201
202func (o updateOptions) rollbackConfig(flags *pflag.FlagSet) *swarm.UpdateConfig {
203 if !anyChanged(flags, flagRollbackParallelism, flagRollbackDelay, flagRollbackMonitor, flagRollbackFailureAction, flagRollbackMaxFailureRatio, flagRollbackOrder) {

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