Skip to content

Commit

Permalink
refactor(config): introduce --images-to-build
Browse files Browse the repository at this point in the history
it solves docker#8994

Signed-off-by: abdennour <mail@abdennoor.com>
  • Loading branch information
abdennour committed Jan 2, 2022
1 parent fe7e30a commit 4223ade
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cmd/compose/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ type convertOptions struct {
profiles bool
images bool
hash string
builtImages bool
imagesToBuild bool
}

func convertCommand(p *projectOptions, backend api.Service) *cobra.Command {
Expand Down Expand Up @@ -87,7 +87,7 @@ func convertCommand(p *projectOptions, backend api.Service) *cobra.Command {
if opts.profiles {
return runProfiles(opts, args)
}
if opts.images || opts.builtImages {
if opts.images || opts.imagesToBuild {
return runConfigImages(opts, args)
}

Expand All @@ -106,7 +106,7 @@ func convertCommand(p *projectOptions, backend api.Service) *cobra.Command {
flags.BoolVar(&opts.volumes, "volumes", false, "Print the volume names, one per line.")
flags.BoolVar(&opts.profiles, "profiles", false, "Print the profile names, one per line.")
flags.BoolVar(&opts.images, "images", false, "Print the image names, one per line.")
flags.BoolVar(&opts.builtImages, "built-images", false, "Print only built image names, one per line")
flags.BoolVar(&opts.imagesToBuild, "images-to-build", false, "Print only built image names, one per line")
flags.StringVar(&opts.hash, "hash", "", "Print the service config hash, one per line.")
flags.StringVarP(&opts.Output, "output", "o", "", "Save to file (default to stdout)")

Expand Down Expand Up @@ -229,7 +229,7 @@ func runConfigImages(opts convertOptions, services []string) error {
return err
}
for _, s := range project.Services {
if !opts.builtImages || (opts.builtImages && s.Build != nil) {
if !opts.imagesToBuild || (opts.imagesToBuild && s.Build != nil) {
fmt.Println(getImageName(s, *project))
}
}
Expand Down

0 comments on commit 4223ade

Please sign in to comment.