// SpecHasTag returns named tag from image stream's spec and boolean whether one was found.
761492
func SpecHasTag(stream *imagev1.ImageStream, name string) (imagev1.TagReference, bool) {
	for _, tag := range stream.Spec.Tags {
		if tag.Name == name {
			return tag, true
		}
	}
	return imagev1.TagReference{}, false
}
208226
func (c *connection) ImageByTag(namespace, name, tag string) (*Image, error) {
	if len(namespace) == 0 && reference.IsRegistryDockerHub(c.url.Host) {
		namespace = "library"
	}
	if len(name) == 0 {
		return nil, fmt.Errorf("image name must be specified")
	}
	searchTag := tag
	if len(searchTag) == 0 {
		searchTag = "latest"
	}

	repo, err := c.getCachedRepository(fmt.Sprintf("%s/%s", namespace, name))
	if err != nil {
		return nil, err
	}

	image, _, err := repo.getTaggedImage(c, searchTag, tag)
	return image, err
}
1195828
func validateTag(rawRepo string) error {
	_, err := reference.ParseNormalizedNamed(rawRepo)

	return err
}
427258
func (f *Field) AddTag(tag string) FieldInterface {
	f.tag[tag] = struct{}{}
	return f
}
442602
func SplitImageStreamTag(nameAndTag string) (name string, tag string, ok bool) {
	parts := strings.SplitN(nameAndTag, ":", 2)
	name = parts[0]
	if len(parts) > 1 {
		tag = parts[1]
	}
	if len(tag) == 0 {
		tag = DefaultImageTag
	}
	return name, tag, len(parts) == 2
}
728944
func HasTagCondition(stream *ImageStream, tag string, condition TagEventCondition) bool {
	for _, existing := range stream.Status.Tags[tag].Conditions {
		if condition.Type == existing.Type && condition.Status == existing.Status && condition.Reason == existing.Reason {
			return true
		}
	}
	return false
}
552393
func RegisterTag(name string, parserFn TagParser) error {
	_, existing := tags[name]
	if existing {
		return errors.Errorf("tag with name '%s' is already registered", name)
	}
	tags[name] = &tag{
		name:   name,
		parser: parserFn,
	}
	return nil
}
997497
func (p *propTags) HasTag(target string) bool {

	for _, tag := range p.Tags {
		if target == tag {
			return true
		}
	}

	return false
}
1188061
func parseFieldTag(structField reflect.StructField, dosaAnnotation string) (*ColumnDefinition, error) {
	typ, isPointer, err := typify(structField.Type)
	if err != nil {
		return nil, err
	}
	return parseField(typ, isPointer, structField.Name, dosaAnnotation)
}
1003996
func tagsFromMapEC(m map[string]interface{}) []*elasticache.Tag {
	result := make([]*elasticache.Tag, 0, len(m))
	for k, v := range m {
		t := &elasticache.Tag{
			Key:   aws.String(k),
			Value: aws.String(v.(string)),
		}
		if !tagIgnoredEC(t) {
			result = append(result, t)
		}
	}

	return result
}
718937
func ValidateImageStreamTagWithWhitelister(
	whitelister whitelist.RegistryWhitelister,
	ist *imageapi.ImageStreamTag,
) field.ErrorList {
	result := validation.ValidateObjectMeta(&ist.ObjectMeta, true, path.ValidatePathSegmentName, field.NewPath("metadata"))

	if ist.Tag != nil {
		// TODO: verify that istag inherits imagestream's annotations
		insecureRepository := isRepositoryInsecure(ist)
		result = append(result, ValidateImageStreamTagReference(whitelister, insecureRepository, *ist.Tag, field.NewPath("tag"))...)
		if ist.Tag.Annotations != nil && !kapihelper.Semantic.DeepEqual(ist.Tag.Annotations, ist.ObjectMeta.Annotations) {
			result = append(result, field.Invalid(field.NewPath("tag", "annotations"), "<map>", "tag annotations must not be provided or must be equal to the object meta annotations"))
		}
	}

	return result
}
1141686
func acceptedHTMLTag(tagName string) bool {
	for _, tag := range acceptedHTMLTags {
		if tag == tagName {
			return true
		}
	}
	return false
}
286738
func (tf *TemplateFunctions) HasTag(tag string) bool {
	_, found := tf.tags[tag]
	return found
}
1346443
func generateValidImageTag() name.Tag {
	var tag name.Tag
	var err error
	var i int
	b := make([]rune, 12)
	for {
		for i = 0; i < len(b); i++ {
			b[i] = letters[rand.Intn(len(letters))]
		}
		tag, err = name.NewTag("rpm_test_image:"+string(b), name.WeakValidation)
		if err != nil {
			logrus.Warn(err.Error())
			continue
		}
		img, _ := daemon.Image(tag)
		if img == nil {
			break
		}
	}
	return tag
}
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)
}
960915
func (set *TemplateSet) BanTag(name string) error {
	_, has := tags[name]
	if !has {
		return errors.Errorf("tag '%s' not found", name)
	}
	if set.firstTemplateCreated {
		return errors.New("you cannot ban any tags after you've added your first template to your template set")
	}
	_, has = set.bannedTags[name]
	if has {
		return errors.Errorf("tag '%s' is already banned", name)
	}
	set.bannedTags[name] = true

	return nil
}
381674
func (mr *MockRuntimeReaderMockRecorder) Tag(arg0 interface{}) *gomock.Call {
	return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Tag", reflect.TypeOf((*MockRuntimeReader)(nil).Tag), arg0)
}