MCPcopy
hub / github.com/docker/compose / ensureProjectVolumes

Method ensureProjectVolumes

pkg/compose/create.go:155–169  ·  view source on GitHub ↗
(ctx context.Context, project *types.Project)

Source from the content-addressed store, hash-verified

153}
154
155func (s *composeService) ensureProjectVolumes(ctx context.Context, project *types.Project) (map[string]string, error) {
156 ids := map[string]string{}
157 for k, volume := range project.Volumes {
158 volume.CustomLabels = volume.CustomLabels.Add(api.VolumeLabel, k)
159 volume.CustomLabels = volume.CustomLabels.Add(api.ProjectLabel, project.Name)
160 volume.CustomLabels = volume.CustomLabels.Add(api.VersionLabel, api.ComposeVersion)
161 id, err := s.ensureVolume(ctx, k, volume, project)
162 if err != nil {
163 return nil, err
164 }
165 ids[k] = id
166 }
167
168 return ids, nil
169}
170
171//nolint:gocyclo
172func (s *composeService) getCreateConfigs(ctx context.Context,

Callers 1

createMethod · 0.95

Calls 2

ensureVolumeMethod · 0.95
AddMethod · 0.45

Tested by

no test coverage detected