Skip to content

Commit

Permalink
add format flag for 'image ls' command
Browse files Browse the repository at this point in the history
  • Loading branch information
presztak committed Nov 21, 2021
1 parent 212e99a commit 670be8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/minikube/cmd/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ var (
dockerFile string
buildEnv []string
buildOpt []string
format string
)

func saveFile(r io.Reader) (string, error) {
Expand Down Expand Up @@ -331,7 +332,7 @@ $ minikube image ls
exit.Error(reason.Usage, "loading profile", err)
}

if err := machine.ListImages(profile); err != nil {
if err := machine.ListImages(profile, format); err != nil {
exit.Error(reason.GuestImageList, "Failed to list images", err)
}
},
Expand Down Expand Up @@ -396,6 +397,7 @@ func init() {
saveImageCmd.Flags().BoolVar(&imgDaemon, "daemon", false, "Cache image to docker daemon")
saveImageCmd.Flags().BoolVar(&imgRemote, "remote", false, "Cache image to remote registry")
imageCmd.AddCommand(saveImageCmd)
listImageCmd.Flags().StringVarP(&format, "format", "", "short", "Format output. One of: short|table|json|yaml")
imageCmd.AddCommand(listImageCmd)
imageCmd.AddCommand(tagImageCmd)
imageCmd.AddCommand(pushImageCmd)
Expand Down

0 comments on commit 670be8a

Please sign in to comment.