@@ -93,7 +93,7 @@ func (s *composeService) create(ctx context.Context, project *types.Project, opt
9393 return err
9494 }
9595
96- volumes , err := s .ensureProjectVolumes (ctx , project , options . AssumeYes )
96+ volumes , err := s .ensureProjectVolumes (ctx , project )
9797 if err != nil {
9898 return err
9999 }
@@ -150,13 +150,13 @@ func (s *composeService) ensureNetworks(ctx context.Context, project *types.Proj
150150 return networks , nil
151151}
152152
153- func (s * composeService ) ensureProjectVolumes (ctx context.Context , project * types.Project , assumeYes bool ) (map [string ]string , error ) {
153+ func (s * composeService ) ensureProjectVolumes (ctx context.Context , project * types.Project ) (map [string ]string , error ) {
154154 ids := map [string ]string {}
155155 for k , volume := range project .Volumes {
156156 volume .CustomLabels = volume .CustomLabels .Add (api .VolumeLabel , k )
157157 volume .CustomLabels = volume .CustomLabels .Add (api .ProjectLabel , project .Name )
158158 volume .CustomLabels = volume .CustomLabels .Add (api .VersionLabel , api .ComposeVersion )
159- id , err := s .ensureVolume (ctx , k , volume , project , assumeYes )
159+ id , err := s .ensureVolume (ctx , k , volume , project )
160160 if err != nil {
161161 return nil , err
162162 }
@@ -1529,7 +1529,7 @@ func (s *composeService) resolveExternalNetwork(ctx context.Context, n *types.Ne
15291529 }
15301530}
15311531
1532- func (s * composeService ) ensureVolume (ctx context.Context , name string , volume types.VolumeConfig , project * types.Project , assumeYes bool ) (string , error ) {
1532+ func (s * composeService ) ensureVolume (ctx context.Context , name string , volume types.VolumeConfig , project * types.Project ) (string , error ) {
15331533 inspected , err := s .apiClient ().VolumeInspect (ctx , volume .Name )
15341534 if err != nil {
15351535 if ! errdefs .IsNotFound (err ) {
@@ -1561,13 +1561,10 @@ func (s *composeService) ensureVolume(ctx context.Context, name string, volume t
15611561 }
15621562 actual , ok := inspected .Labels [api .ConfigHashLabel ]
15631563 if ok && actual != expected {
1564- confirm := assumeYes
1565- if ! assumeYes {
1566- msg := fmt .Sprintf ("Volume %q exists but doesn't match configuration in compose file. Recreate (data will be lost)?" , volume .Name )
1567- confirm , err = s .prompt (msg , false )
1568- if err != nil {
1569- return "" , err
1570- }
1564+ msg := fmt .Sprintf ("Volume %q exists but doesn't match configuration in compose file. Recreate (data will be lost)?" , volume .Name )
1565+ confirm , err := s .prompt (msg , false )
1566+ if err != nil {
1567+ return "" , err
15711568 }
15721569 if confirm {
15731570 err = s .removeDivergedVolume (ctx , name , volume , project )
0 commit comments