MCPcopy
hub / github.com/containers/toolbox / ImageReferenceGetTag

Function ImageReferenceGetTag

src/pkg/utils/utils.go:601–615  ·  view source on GitHub ↗
(image string)

Source from the content-addressed store, hash-verified

599}
600
601func 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.
618func ImageReferenceHasDomain(image string) bool {

Calls 1

ImageReferenceHasDomainFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…