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

Function volumeRequiresMountAPI

pkg/compose/create.go:977–990  ·  view source on GitHub ↗

volumeRequiresMountAPI check if Volume declaration can be implemented by the plain old Bind API or uses any of the advanced options which require use of Mount API

(vol *types.ServiceVolumeVolume)

Source from the content-addressed store, hash-verified

975// volumeRequiresMountAPI check if Volume declaration can be implemented by the plain old Bind API or uses any of the advanced
976// options which require use of Mount API
977func volumeRequiresMountAPI(vol *types.ServiceVolumeVolume) bool {
978 switch {
979 case vol == nil:
980 return false
981 case len(vol.Labels) > 0:
982 return true
983 case vol.Subpath != "":
984 return true
985 case vol.NoCopy:
986 return true
987 default:
988 return false
989 }
990}
991
992func (s *composeService) buildContainerMountOptions(ctx context.Context, p types.Project, service types.ServiceConfig, inherit *container.Summary) ([]mount.Mount, error) {
993 mounts := map[string]mount.Mount{}

Callers 1

buildContainerVolumesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected