@@ -82,7 +82,7 @@ func (s *composeService) down(ctx context.Context, projectName string, options a
8282 ops := s .ensureNetworksDown (ctx , project , w )
8383
8484 if options .Images != "" {
85- ops = append (ops , s .ensureImagesDown (ctx , projectName , options , w )... )
85+ ops = append (ops , s .ensureImagesDown (ctx , project , options , w )... )
8686 }
8787
8888 if options .Volumes {
@@ -114,9 +114,9 @@ func (s *composeService) ensureVolumesDown(ctx context.Context, project *types.P
114114 return ops
115115}
116116
117- func (s * composeService ) ensureImagesDown (ctx context.Context , projectName string , options api.DownOptions , w progress.Writer ) []downOp {
117+ func (s * composeService ) ensureImagesDown (ctx context.Context , project * types. Project , options api.DownOptions , w progress.Writer ) []downOp {
118118 var ops []downOp
119- for image := range s .getServiceImages (options , projectName ) {
119+ for image := range s .getServiceImages (options , project ) {
120120 image := image
121121 ops = append (ops , func () error {
122122 return s .removeImage (ctx , image , w )
@@ -144,15 +144,15 @@ func (s *composeService) ensureNetworksDown(ctx context.Context, project *types.
144144 return ops
145145}
146146
147- func (s * composeService ) getServiceImages (options api.DownOptions , projectName string ) map [string ]struct {} {
147+ func (s * composeService ) getServiceImages (options api.DownOptions , project * types. Project ) map [string ]struct {} {
148148 images := map [string ]struct {}{}
149- for _ , service := range options . Project .Services {
149+ for _ , service := range project .Services {
150150 image := service .Image
151151 if options .Images == "local" && image != "" {
152152 continue
153153 }
154154 if image == "" {
155- image = getImageName (service , projectName )
155+ image = getImageName (service , project . Name )
156156 }
157157 images [image ] = struct {}{}
158158 }
0 commit comments