(ctx context.Context, volume types.VolumeConfig)
| 1686 | } |
| 1687 | |
| 1688 | func (s *composeService) createVolume(ctx context.Context, volume types.VolumeConfig) error { |
| 1689 | eventName := fmt.Sprintf("Volume %s", volume.Name) |
| 1690 | s.events.On(creatingEvent(eventName)) |
| 1691 | hash, err := VolumeHash(volume) |
| 1692 | if err != nil { |
| 1693 | return err |
| 1694 | } |
| 1695 | volume.CustomLabels.Add(api.ConfigHashLabel, hash) |
| 1696 | _, err = s.apiClient().VolumeCreate(ctx, client.VolumeCreateOptions{ |
| 1697 | Labels: mergeLabels(volume.Labels, volume.CustomLabels), |
| 1698 | Name: volume.Name, |
| 1699 | Driver: volume.Driver, |
| 1700 | DriverOpts: volume.DriverOpts, |
| 1701 | }) |
| 1702 | if err != nil { |
| 1703 | s.events.On(errorEvent(eventName, err.Error())) |
| 1704 | return err |
| 1705 | } |
| 1706 | s.events.On(createdEvent(eventName)) |
| 1707 | return nil |
| 1708 | } |
| 1709 | |
| 1710 | func parseIPAMPool(pool *types.IPAMPool) (network.IPAMConfig, error) { |
| 1711 | var ( |
no test coverage detected