// Convert_image_ImageStreamTag_To_v1_ImageStreamTag is an autogenerated conversion function.
965390
func Convert_image_ImageStreamTag_To_v1_ImageStreamTag(in *image.ImageStreamTag, out *v1.ImageStreamTag, s conversion.Scope) error {
	return autoConvert_image_ImageStreamTag_To_v1_ImageStreamTag(in, out, s)
}
89068
func (cli *Client) ImageTag(ctx context.Context, source, target string) error {
	if _, err := reference.ParseAnyReference(source); err != nil {
		return errors.Wrapf(err, "Error parsing reference: %q is not a valid repository/tag", source)
	}

	ref, err := reference.ParseNormalizedNamed(target)
	if err != nil {
		return errors.Wrapf(err, "Error parsing reference: %q is not a valid repository/tag", target)
	}

	if _, isCanonical := ref.(reference.Canonical); isCanonical {
		return errors.New("refusing to create a tag with a digest reference")
	}

	ref = reference.TagNameOnly(ref)

	query := url.Values{}
	query.Set("repo", reference.FamiliarName(ref))
	if tagged, ok := ref.(reference.Tagged); ok {
		query.Set("tag", tagged.Tag())
	}

	resp, err := cli.post(ctx, "/images/"+source+"/tag", query, nil, nil)
	ensureReaderClosed(resp)
	return err
}
318902
func ValidateImageStreamTagUpdate(newIST, oldIST *imageapi.ImageStreamTag) field.ErrorList {
	return ValidateImageStreamTagUpdateWithWhitelister(nil, newIST, oldIST)
}
591112
func Convert_image_ImageStreamImport_To_v1_ImageStreamImport(in *image.ImageStreamImport, out *v1.ImageStreamImport, s conversion.Scope) error {
	return autoConvert_image_ImageStreamImport_To_v1_ImageStreamImport(in, out, s)
}
897146
func Convert_image_ImageStreamLayers_To_v1_ImageStreamLayers(in *image.ImageStreamLayers, out *v1.ImageStreamLayers, s conversion.Scope) error {
	return autoConvert_image_ImageStreamLayers_To_v1_ImageStreamLayers(in, out, s)
}
1014306
func (c *imageStreamTags) Create(imageStreamTag *image.ImageStreamTag) (result *image.ImageStreamTag, err error) {
	result = &image.ImageStreamTag{}
	err = c.client.Post().
		Namespace(c.ns).
		Resource("imagestreamtags").
		Body(imageStreamTag).
		Do().
		Into(result)
	return
}
814158
func imageWithTagString(image string) string {
	namedRef, err := reference.ParseNormalizedNamed(image)
	if err == nil {
		return reference.FamiliarString(reference.TagNameOnly(namedRef))
	}
	return ""
}
1556
func getImageStreamTagMarker(g osgraph.Graph, f osgraph.Namer, bcInputNode graph.Node, imageStreamNode graph.Node, tagNode *imagegraph.ImageStreamTagNode, bcNode graph.Node) osgraph.Marker {
	return osgraph.Marker{
		Node: bcNode,
		RelatedNodes: []graph.Node{bcInputNode,
			imageStreamNode},
		Severity:   osgraph.WarningSeverity,
		Key:        MissingImageStreamImageWarning,
		Message:    fmt.Sprintf("%s builds from %s, but the image stream tag does not exist.", f.ResourceName(bcNode), f.ResourceName(bcInputNode)),
		Suggestion: getImageStreamTagSuggestion(g, f, tagNode),
	}
}
1155424
func RemoveTag(image string) string {
	if !HasTag(image) {
		return image
	}
	tagRegex := regexp.MustCompile(tagRegexStr)
	parts := tagRegex.FindStringSubmatch(image)
	tag := parts[len(parts)-1]
	return image[0 : len(image)-len(tag)-1]
}
230755
func (r *ImageRef) ImageStreamTag() (*imagev1.ImageStreamTag, error) {
	name, ok := r.SuggestName()
	if !ok {
		return nil, fmt.Errorf("unable to suggest an ImageStream name for %q", r.Reference.String())
	}
	istname := imageapi.JoinImageStreamTag(name, r.Reference.Tag)
	ist := &imagev1.ImageStreamTag{
		// this is ok because we know exactly how we want to be serialized
		TypeMeta: metav1.TypeMeta{APIVersion: imagev1.SchemeGroupVersion.String(), Kind: "ImageStreamTag"},
		ObjectMeta: metav1.ObjectMeta{
			Name:        istname,
			Namespace:   r.SuggestNamespace(),
			Annotations: map[string]string{"openshift.io/imported-from": r.Reference.Exact()},
		},
		Tag: &imagev1.TagReference{
			Name: r.InternalTag(),
			From: &corev1.ObjectReference{
				Kind: "DockerImage",
				Name: r.PullSpec(),
			},
			ImportPolicy: imagev1.TagImportPolicy{Insecure: r.Insecure},
		},
	}
	return ist, nil
}
223313
func MatchImageStreamTag(label labels.Selector, field fields.Selector) kstorage.SelectionPredicate {
	return kstorage.SelectionPredicate{
		Label: label,
		Field: field,
		GetAttrs: func(o runtime.Object) (labels.Set, fields.Set, bool, error) {
			obj, ok := o.(*imageapi.ImageStreamTag)
			if !ok {
				return nil, nil, false, fmt.Errorf("not an ImageStreamTag")
			}
			return labels.Set(obj.Labels), SelectableFields(obj), obj.Initializers != nil, nil
		},
	}
}
91021
func IsBuilderStreamTag(stream *imagev1.ImageStream, tag string) bool {
	if stream == nil {
		return false
	}

	// Has the tag annotation
	t, hasTag := imageutil.SpecHasTag(stream, tag)
	if !hasTag {
		return false
	}

	return imageutil.HasAnnotationTag(&t, "builder")
}
569211
func Convert_image_TagReferencePolicy_To_v1_TagReferencePolicy(in *image.TagReferencePolicy, out *v1.TagReferencePolicy, s conversion.Scope) error {
	return autoConvert_image_TagReferencePolicy_To_v1_TagReferencePolicy(in, out, s)
}
1186489
func Convert_image_TagEventCondition_To_v1_TagEventCondition(in *image.TagEventCondition, out *v1.TagEventCondition, s conversion.Scope) error {
	return autoConvert_image_TagEventCondition_To_v1_TagEventCondition(in, out, s)
}
10837
func Convert_v1_ImageLabel_To_build_ImageLabel(in *v1.ImageLabel, out *build.ImageLabel, s conversion.Scope) error {
	return autoConvert_v1_ImageLabel_To_build_ImageLabel(in, out, s)
}
30359
func UpdateChangedTrackingTags(new, old *ImageStream) int {
	changes := 0
	for newTag, newImages := range new.Status.Tags {
		if len(newImages.Items) == 0 {
			continue
		}
		if old != nil {
			oldImages := old.Status.Tags[newTag]
			changed, deleted := tagsChanged(newImages.Items, oldImages.Items)
			if !changed || deleted {
				continue
			}
		}
		changes += UpdateTrackingTags(new, newTag, newImages.Items[0])
	}
	return changes
}
944815
func StatusHasTag(stream *imagev1.ImageStream, name string) (imagev1.NamedTagEventList, bool) {
	for _, tag := range stream.Status.Tags {
		if tag.Tag == name {
			return tag, true
		}
	}
	return imagev1.NamedTagEventList{}, false
}