File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed
Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,33 @@ func HasImage(dclient *dockerapi.Client, imageRef string) error {
8181 return ErrNotFound
8282 }
8383
84- return nil
84+ for _ , img := range imageList {
85+ if strings .HasPrefix (img .ID , "sha" ) {
86+ parts := strings .Split (img .ID , ":" )
87+ if len (parts ) == 2 && parts [1 ] == imageRef {
88+ return nil
89+ }
90+ } else {
91+ if img .ID == imageRef {
92+ return nil
93+ }
94+ }
95+
96+ for _ , tag := range img .RepoTags {
97+ if tag == imageRef {
98+ return nil
99+ }
100+
101+ if ! strings .Contains (imageRef , ":" ) {
102+ target := fmt .Sprintf ("%s:latest" , imageRef )
103+ if tag == target {
104+ return nil
105+ }
106+ }
107+ }
108+ }
109+
110+ return ErrNotFound
85111}
86112
87113func ListImages (dclient * dockerapi.Client , imageNameFilter string ) (map [string ]BasicImageProps , error ) {
You can’t perform that action at this time.
0 commit comments