Skip to content

Commit ff60862

Browse files
author
Mehrad
committed
update image delete
1 parent 44db927 commit ff60862

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

cmd/image.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package cmd
22

33
import (
44
"github.com/spf13/cobra"
5+
ybApi "github.com/yottab/proto-api/proto"
56
)
67

78
func imgList(cmd *cobra.Command, args []string) {
@@ -23,10 +24,16 @@ func imgInfo(cmd *cobra.Command, args []string) {
2324
}
2425

2526
func imgDelete(cmd *cobra.Command, args []string) {
26-
req := getCliRequestIdentity(args, 0)
27+
imageTag := cmd.Flag("tag").Value.String() // Repository tag
28+
imageName := cmd.Flag("name").Value.String() // Repository name
29+
30+
req := new(ybApi.ImgBuildReq)
31+
req.RepositoryName = imageName
32+
req.RepositoryTag = imageTag
33+
2734
client := grpcConnect()
2835
defer client.Close()
2936
_, err := client.V2().ImgDelete(client.Context(), req)
3037
uiCheckErr("Could not Destroy the Image", err)
31-
log.Printf("image %s deleted", req.Name)
38+
log.Printf("image %s:%s deleted", req.RepositoryName, req.RepositoryTag)
3239
}

0 commit comments

Comments
 (0)