(client *client.Client, imageItem string)
| 1697 | } |
| 1698 | |
| 1699 | func checkImageExist(client *client.Client, imageItem string) bool { |
| 1700 | if client == nil { |
| 1701 | var err error |
| 1702 | client, err = docker.NewDockerClient() |
| 1703 | if err != nil { |
| 1704 | return false |
| 1705 | } |
| 1706 | } |
| 1707 | images, err := client.ImageList(context.Background(), image.ListOptions{}) |
| 1708 | if err != nil { |
| 1709 | return false |
| 1710 | } |
| 1711 | |
| 1712 | for _, img := range images { |
| 1713 | for _, tag := range img.RepoTags { |
| 1714 | if tag == imageItem || tag == imageItem+":latest" { |
| 1715 | return true |
| 1716 | } |
| 1717 | } |
| 1718 | } |
| 1719 | return false |
| 1720 | } |
| 1721 | |
| 1722 | func checkImageLike(client *client.Client, imageName string) bool { |
| 1723 | if client == nil { |
no outgoing calls
no test coverage detected