MCPcopy Index your code
hub / github.com/docker/cli / initializeUpdater

Function initializeUpdater

cli/command/service/progress/progress.go:234–254  ·  view source on GitHub ↗
(service swarm.Service, progressOut progress.Output)

Source from the content-addressed store, hash-verified

232}
233
234func initializeUpdater(service swarm.Service, progressOut progress.Output) (progressUpdater, error) {
235 if service.Spec.Mode.Replicated != nil && service.Spec.Mode.Replicated.Replicas != nil {
236 return &replicatedProgressUpdater{
237 progressOut: progressOut,
238 }, nil
239 }
240 if service.Spec.Mode.Global != nil {
241 return &globalProgressUpdater{
242 progressOut: progressOut,
243 }, nil
244 }
245 if service.Spec.Mode.ReplicatedJob != nil {
246 return newReplicatedJobProgressUpdater(service, progressOut), nil
247 }
248 if service.Spec.Mode.GlobalJob != nil {
249 return &globalJobProgressUpdater{
250 progressOut: progressOut,
251 }, nil
252 }
253 return nil, errors.New("unrecognized service mode")
254}
255
256func writeOverallProgress(progressOut progress.Output, numerator, denominator int, rollback bool) {
257 if rollback {

Callers 1

ServiceProgressFunction · 0.85

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…