func resolveReferenceForTagEvent(stream *imagev1.ImageStream, tag string, latest *imagev1.TagEvent) string {
	// retrieve spec policy - if not found, we use the latest spec
	ref, ok := SpecHasTag(stream, tag)
	if !ok {
		return latest.DockerImageReference
	}

	switch ref.ReferencePolicy.Type {
	// the local reference policy attempts to use image pull through on the integrated
	// registry if possible
	case imagev1.LocalTagReferencePolicy:
		local := stream.Status.DockerImageRepository
		if len(local) == 0 || len(latest.Image) == 0 {
			// fallback to the originating reference if no local docker registry defined or we
			// lack an image ID
			return latest.DockerImageReference
		}

		// we must use imageapi's helper since we're calling Exact later on, which produces string
		ref, err := imagereference.Parse(local)
		if err != nil {
			// fallback to the originating reference if the reported local repository spec is not valid
			return latest.DockerImageReference
		}

		// create a local pullthrough URL
		ref.Tag = ""
		ref.ID = latest.Image
		return ref.Exact()

	// the default policy is to use the originating image
	default:
		return latest.DockerImageReference
	}
}
// ResolveReferenceForTagEvent applies the tag reference rules for a stream, tag, and tag event for
// that tag.
ResolveReferenceForTagEvent applies the tag reference rules for a stream, tag, and tag event for
that tag.
// ResolveReferenceForTagEvent applies the tag reference rules for a stream tag and tag event for // that tag .
func resolveReferenceForTagEvent(stream *imagev1.ImageStream, tag string, latest *imagev1.TagEvent) string {
	ref, ok := SpecHasTag(stream, tag)
	if !ok {
		return latest.DockerImageReference
	}
	switch ref.ReferencePolicy.Type {
	case imagev1.LocalTagReferencePolicy:
		local := stream.Status.DockerImageRepository
		if len(local) == 0 || len(latest.Image) == 0 {
			return latest.DockerImageReference
		}
		ref, err := imagereference.Parse(local)
		if err != nil {
			return latest.DockerImageReference
		}
		ref.Tag = ""
		ref.ID = latest.Image
		return ref.Exact()
	default:
		return latest.DockerImageReference
	}
}
func resolveReferenceForTagEvent ( stream * imagev1 . ImageStream , tag string , latest * imagev1 . TagEvent ) string { ref , ok := SpecHasTag ( stream , tag ) if ! ok { return latest . DockerImageReference } switch ref . ReferencePolicy . Type { case imagev1 . LocalTagReferencePolicy : local := stream . Status . DockerImageRepository if len ( local ) == 0 || len ( latest . Image ) == 0 { return latest . DockerImageReference } ref , err := imagereference . Parse ( local ) if err != nil { return latest . DockerImageReference } ref . Tag = " " ref . ID = latest . Image return ref . Exact ( ) default : return latest . DockerImageReference } }
ResolveReferenceForTagEvent applies the tag reference rules for a stream, tag, and tag event for
that tag.
ResolveReferenceForTagEvent applies the tag reference rules for a stream tag and tag event for that tag .
// retrieve spec policy - if not found, we use the latest spec // the local reference policy attempts to use image pull through on the integrated // registry if possible // fallback to the originating reference if no local docker registry defined or we // lack an image ID // we must use imageapi's helper since we're calling Exact later on, which produces string // fallback to the originating reference if the reported local repository spec is not valid // create a local pullthrough URL // the default policy is to use the originating image