@@ -199,9 +199,9 @@ var setLabelsCommand = cli.Command{
199199
200200var checkCommand = cli.Command {
201201 Name : "check" ,
202- Usage : "check that an image has all content available locally" ,
202+ Usage : "check existing images to ensure all content is available locally" ,
203203 ArgsUsage : "[flags] [<filter>, ...]" ,
204- Description : "check that an image has all content available locally" ,
204+ Description : "check existing images to ensure all content is available locally" ,
205205 Flags : commands .SnapshotterFlags ,
206206 Action : func (context * cli.Context ) error {
207207 var (
@@ -212,17 +212,21 @@ var checkCommand = cli.Command{
212212 return err
213213 }
214214 defer cancel ()
215- var (
216- contentStore = client .ContentStore ()
217- tw = tabwriter .NewWriter (os .Stdout , 1 , 8 , 1 , ' ' , 0 )
218- )
219- fmt .Fprintln (tw , "REF\t TYPE\t DIGEST\t STATUS\t SIZE\t UNPACKED\t " )
215+
216+ var contentStore = client .ContentStore ()
220217
221218 args := []string (context .Args ())
222219 imageList , err := client .ListImages (ctx , args ... )
223220 if err != nil {
224221 return errors .Wrap (err , "failed listing images" )
225222 }
223+ if len (imageList ) == 0 {
224+ log .G (ctx ).Debugf ("no images found" )
225+ return exitErr
226+ }
227+
228+ var tw = tabwriter .NewWriter (os .Stdout , 1 , 8 , 1 , ' ' , 0 )
229+ fmt .Fprintln (tw , "REF\t TYPE\t DIGEST\t STATUS\t SIZE\t UNPACKED\t " )
226230
227231 for _ , image := range imageList {
228232 var (
0 commit comments