github.com/cloud-foundations/dominator@v0.0.0-20221004181915-6e4fee580046/cmd/imagetool/checkImage.go (about) 1 package main 2 3 import ( 4 "fmt" 5 "os" 6 7 "github.com/Cloud-Foundations/Dominator/imageserver/client" 8 "github.com/Cloud-Foundations/Dominator/lib/log" 9 ) 10 11 func checkImageSubcommand(args []string, logger log.DebugLogger) error { 12 imageSClient, _ := getClients() 13 imageExists, err := client.CheckImage(imageSClient, args[0]) 14 if err != nil { 15 return fmt.Errorf("Error checking image: %s", err) 16 } 17 if imageExists { 18 return nil 19 } 20 os.Exit(1) 21 panic("impossible") 22 }