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

Function Services

cli/compose/convert/service.go:34–59  ·  view source on GitHub ↗

Services from compose-file types to engine API types

(
	ctx context.Context,
	namespace Namespace,
	config *composetypes.Config,
	apiClient client.APIClient,
)

Source from the content-addressed store, hash-verified

32
33// Services from compose-file types to engine API types
34func Services(
35 ctx context.Context,
36 namespace Namespace,
37 config *composetypes.Config,
38 apiClient client.APIClient,
39) (map[string]swarm.ServiceSpec, error) {
40 result := make(map[string]swarm.ServiceSpec)
41 for _, service := range config.Services {
42 secrets, err := convertServiceSecrets(ctx, apiClient, namespace, service.Secrets, config.Secrets)
43 if err != nil {
44 return nil, fmt.Errorf("service %s: %w", service.Name, err)
45 }
46 configs, err := convertServiceConfigObjs(ctx, apiClient, namespace, service, config.Configs)
47 if err != nil {
48 return nil, fmt.Errorf("service %s: %w", service.Name, err)
49 }
50
51 serviceSpec, err := Service(namespace, service, config.Networks, config.Volumes, secrets, configs)
52 if err != nil {
53 return nil, fmt.Errorf("service %s: %w", service.Name, err)
54 }
55 result[service.Name] = serviceSpec
56 }
57
58 return result, nil
59}
60
61// Service converts a ServiceConfig into a swarm ServiceSpec
62func Service(

Callers

nothing calls this directly

Calls 3

convertServiceSecretsFunction · 0.85
convertServiceConfigObjsFunction · 0.85
ServiceFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…