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

Method actualVolumes

pkg/compose/compose.go:435–453  ·  view source on GitHub ↗
(ctx context.Context, projectName string)

Source from the content-addressed store, hash-verified

433}
434
435func (s *composeService) actualVolumes(ctx context.Context, projectName string) (types.Volumes, error) {
436 opts := client.VolumeListOptions{
437 Filters: projectFilter(projectName),
438 }
439 volumes, err := s.apiClient().VolumeList(ctx, opts)
440 if err != nil {
441 return nil, err
442 }
443
444 actual := types.Volumes{}
445 for _, vol := range volumes.Items {
446 actual[vol.Labels[api.VolumeLabel]] = types.VolumeConfig{
447 Name: vol.Name,
448 Driver: vol.Driver,
449 Labels: vol.Labels,
450 }
451 }
452 return actual, nil
453}
454
455func (s *composeService) actualNetworks(ctx context.Context, projectName string) (types.Networks, error) {
456 networks, err := s.apiClient().NetworkList(ctx, client.NetworkListOptions{

Callers 1

Calls 3

apiClientMethod · 0.95
projectFilterFunction · 0.85
VolumeListMethod · 0.45

Tested by

no test coverage detected