diff --git a/cmd/community_images/cli/header.go b/cmd/community_images/cli/header.go index ad672a5..b8854db 100644 --- a/cmd/community_images/cli/header.go +++ b/cmd/community_images/cli/header.go @@ -2,6 +2,7 @@ package cli import ( "fmt" + "github.com/dims/community-images/pkg/community_images" ) @@ -15,8 +16,21 @@ func imageWithTag(image community_images.RunningImage) string { return "" } + location := fmt.Sprintf("\u001B[36m(Location: \u001B[33m%s > %s", image.Namespace, image.Pod) + if image.InitContainer != nil { + location = fmt.Sprintf("%s > \u001B[33m%s", location, *image.InitContainer) + } + if image.Container != nil { + marker := ">" + if image.InitContainer != nil { + marker = "," + } + location = fmt.Sprintf("%s %s \u001B[33m%s", location, marker, *image.Container) + } + location = fmt.Sprintf("%s\u001B[36m)", location) + imageName := fmt.Sprintf("%s/%s", repo, img) truncatedImageName := imageName truncatedTagName := tag - return fmt.Sprintf("%s:%s", truncatedImageName, truncatedTagName) + return fmt.Sprintf("%s:%s %s", truncatedImageName, truncatedTagName, location) }