// NormalizeImageName will normalize image name
428787
func NormalizeImageName(image string) string {
	if !strings.Contains(image, ":") {
		return fmt.Sprintf("%s:latest", image)
	}
	return image
}
24725
func (p *File_Template_Parameter) Normalize() error {
	if p == nil {
		return errors.New("is nil")
	}
	if err := p.Schema.Normalize(); err != nil {
		return fmt.Errorf("schema: %s", err)
	}
	if p.Default != nil {
		if err := p.Default.Normalize(); err != nil {
			return fmt.Errorf("default value: %s", err)
		}
		if err := p.Accepts(p.Default); err != nil {
			return fmt.Errorf("default value: %s", err)
		}
	}
	return nil
}
123030
function normalizeImageName( $imageName )
    {
        // Initialize transformation system
        $trans = eZCharTransform::instance();

        $imageName = eZURLAliasML::convertToAlias( $imageName );
        return $imageName;
    }
1309087
func (s *CopyImageOutput) SetDestinationImageName(v string) *CopyImageOutput {
	s.DestinationImageName = &v
	return s
}
606947
func (f *FakeDocker) RemoveImage(name string) error {
	f.RemoveImageName = name
	return f.RemoveImageError
}
1130119
func (n *SimpleNameNormalizer) Normalize(name string) string {
	var retMe []byte
	nameBytes := []byte(name)
	for i, b := range nameBytes {
		if n.safeByte(b) {
			if retMe != nil {
				retMe[i] = b
			}
		} else {
			if retMe == nil {
				retMe = make([]byte, len(nameBytes))
				copy(retMe[0:i], nameBytes[0:i])
			}
			retMe[i] = n.Replacement
		}
	}
	if retMe == nil {
		return name
	}
	return string(retMe)
}
173041
func (s *CopyImageInput) SetSourceImageName(v string) *CopyImageInput {
	s.SourceImageName = &v
	return s
}
456172
func ParseImageName(image string) (string, string, string, error) {
	named, err := dockerref.ParseNormalizedNamed(image)
	if err != nil {
		return "", "", "", fmt.Errorf("couldn't parse image name: %v", err)
	}

	repoToPull := named.Name()
	var tag, digest string

	tagged, ok := named.(dockerref.Tagged)
	if ok {
		tag = tagged.Tag()
	}

	digested, ok := named.(dockerref.Digested)
	if ok {
		digest = digested.Digest().String()
	}
	// If no tag was specified, use the default "latest".
	if len(tag) == 0 && len(digest) == 0 {
		tag = DefaultImageTag
	}
	return repoToPull, tag, digest, nil
}
1306196
func (i Name) CanonicalName() CanonicalName {
	return CanonicalName{
		Name: Name{
			Domain: i.Registry(),
			Image:  i.Repository(),
		},
	}
}
95954
func (s *UpdateFleetInput) SetImageName(v string) *UpdateFleetInput {
	s.ImageName = &v
	return s
}
1085333
func Normalize(email string) string {
	// Trim whitespaces.
	email = strings.TrimSpace(email)

	// Trim extra dot in hostname.
	email = strings.TrimRight(email, ".")

	// Lowercase.
	email = strings.ToLower(email)

	return email
}
1103729
func (s *ImportWorkspaceImageInput) SetImageName(v string) *ImportWorkspaceImageInput {
	s.ImageName = &v
	return s
}
1323237
func applyDefaultImageTag(image string) (string, error) {
	named, err := dockerref.ParseNormalizedNamed(image)
	if err != nil {
		return "", fmt.Errorf("couldn't parse image reference %q: %v", image, err)
	}
	_, isTagged := named.(dockerref.Tagged)
	_, isDigested := named.(dockerref.Digested)
	if !isTagged && !isDigested {
		// we just concatenate the image name with the default tag here instead
		// of using dockerref.WithTag(named, ...) because that would cause the
		// image to be fully qualified as docker.io/$name if it's a short name
		// (e.g. just busybox). We don't want that to happen to keep the CRI
		// agnostic wrt image names and default hostnames.
		image = image + ":" + parsers.DefaultImageTag
	}
	return image, nil
}
482181
func GetImageNames(ioctx *rados.IOContext) (names []string, err error) {
	buf := make([]byte, 4096)
	for {
		size := C.size_t(len(buf))
		ret := C.rbd_list(C.rados_ioctx_t(ioctx.Pointer()),
			(*C.char)(unsafe.Pointer(&buf[0])), &size)
		if ret == -34 { // FIXME
			buf = make([]byte, size)
			continue
		} else if ret < 0 {
			return nil, RBDError(ret)
		}
		tmp := bytes.Split(buf[:size-1], []byte{0})
		for _, s := range tmp {
			if len(s) > 0 {
				name := C.GoString((*C.char)(unsafe.Pointer(&s[0])))
				names = append(names, name)
			}
		}
		return names, nil
	}
}
588267
func NewFileName(X *xgbutil.XUtil, fileName string) (*Image, error) {
	srcReader, err := os.Open(fileName)
	if err != nil {
		return nil, err
	}
	defer srcReader.Close()

	img, _, err := image.Decode(srcReader)
	if err != nil {
		return nil, err
	}
	return NewConvert(X, img), nil
}
992219
func NormalizeImageStreamTag(name string) string {
	stripped, tag, ok := SplitImageStreamTag(name)
	if !ok {
		// Default to latest
		return JoinImageStreamTag(stripped, tag)
	}
	return name
}
1090481
func sanitizeName(image string) string {
	replace := regexp.MustCompile("[^a-z0-9-]")
	return replace.ReplaceAllString(image, "-")
}