From 7020503dfcfdb0a8de6da433f9d6ddf17cd37462 Mon Sep 17 00:00:00 2001 From: abdennour Date: Fri, 17 Dec 2021 20:53:45 +0300 Subject: [PATCH] refactor(config): introduce --images-to-build it solves #8994 Signed-off-by: abdennour --- cmd/compose/convert.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/compose/convert.go b/cmd/compose/convert.go index 7c59778323..f87a21807f 100644 --- a/cmd/compose/convert.go +++ b/cmd/compose/convert.go @@ -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 { @@ -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) } @@ -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)") @@ -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)) } }