func ImageWithMetadata(image *imagev1.Image) error {
	// Check if the metadata are already filled in for this image.
	meta, hasMetadata := image.DockerImageMetadata.Object.(*docker10.DockerImage)
	if hasMetadata && meta.Size > 0 {
		return nil
	}

	version := image.DockerImageMetadataVersion
	if len(version) == 0 {
		version = "1.0"
	}

	obj := &docker10.DockerImage{}
	if len(image.DockerImageMetadata.Raw) != 0 {
		if err := json.Unmarshal(image.DockerImageMetadata.Raw, obj); err != nil {
			return err
		}
		image.DockerImageMetadata.Object = obj
	}

	image.DockerImageMetadataVersion = version

	return nil
}
// ImageWithMetadata mutates the given image. It parses raw DockerImageManifest data stored in the image and
// fills its DockerImageMetadata and other fields.
// Copied from github.com/openshift/image-registry/pkg/origin-common/util/util.go
ImageWithMetadata mutates the given image. It parses raw DockerImageManifest data stored in the image and
fills its DockerImageMetadata and other fields.
Copied from github.com/openshift/image-registry/pkg/origin-common/util/util.go
// ImageWithMetadata mutates the given image . It parses raw DockerImageManifest data stored in the image and // fills its DockerImageMetadata and other fields . // Copied from github . com / openshift / image - registry / pkg / origin - common / util / util . go
func ImageWithMetadata(image *imagev1.Image) error {
	meta, hasMetadata := image.DockerImageMetadata.Object.(*docker10.DockerImage)
	if hasMetadata && meta.Size > 0 {
		return nil
	}
	version := image.DockerImageMetadataVersion
	if len(version) == 0 {
		version = "1.0"
	}
	obj := &docker10.DockerImage{}
	if len(image.DockerImageMetadata.Raw) != 0 {
		if err := json.Unmarshal(image.DockerImageMetadata.Raw, obj); err != nil {
			return err
		}
		image.DockerImageMetadata.Object = obj
	}
	image.DockerImageMetadataVersion = version
	return nil
}
func ImageWithMetadata ( image * imagev1 . Image ) error { meta , hasMetadata := image . DockerImageMetadata . Object . ( * docker10 . DockerImage ) if hasMetadata && meta . Size > 0 { return nil } version := image . DockerImageMetadataVersion if len ( version ) == 0 { version = " " } obj := & docker10 . DockerImage { } if len ( image . DockerImageMetadata . Raw ) != 0 { if err := json . Unmarshal ( image . DockerImageMetadata . Raw , obj ) ; err != nil { return err } image . DockerImageMetadata . Object = obj } image . DockerImageMetadataVersion = version return nil }
ImageWithMetadata mutates the given image.
ImageWithMetadata mutates the given image .
// Check if the metadata are already filled in for this image.