(image string)
| 599 | } |
| 600 | |
| 601 | func ImageReferenceGetTag(image string) string { |
| 602 | var i int |
| 603 | if ImageReferenceHasDomain(image) { |
| 604 | i = strings.IndexRune(image, '/') |
| 605 | } |
| 606 | |
| 607 | remainder := image[i:] |
| 608 | j := strings.IndexRune(remainder, ':') |
| 609 | if j == -1 { |
| 610 | return "" |
| 611 | } |
| 612 | |
| 613 | tag := remainder[j+1:] |
| 614 | return tag |
| 615 | } |
| 616 | |
| 617 | // ImageReferenceHasDomain checks if the provided image has a domain definition in it. |
| 618 | func ImageReferenceHasDomain(image string) bool { |
no test coverage detected
searching dependent graphs…