(img string)
| 119 | } |
| 120 | |
| 121 | func SplitDockerImage(img string) (string, string, string) { |
| 122 | index := 0 |
| 123 | repository := img |
| 124 | var registry, tag string |
| 125 | if strings.Contains(img, "/") { |
| 126 | separator := strings.Index(img, "/") |
| 127 | registry = img[index:separator] |
| 128 | index = separator + 1 |
| 129 | repository = img[index:] |
| 130 | } |
| 131 | |
| 132 | if strings.Contains(repository, ":") { |
| 133 | separator := strings.Index(repository, ":") |
| 134 | tag = repository[separator+1:] |
| 135 | repository = repository[0:separator] |
| 136 | } |
| 137 | |
| 138 | return registry, repository, tag |
| 139 | } |
no outgoing calls