Example #1
0
func autoConvert_v1_TagReference_To_api_TagReference(in *TagReference, out *image_api.TagReference, s conversion.Scope) error {
	out.Name = in.Name
	if in.Annotations != nil {
		in, out := &in.Annotations, &out.Annotations
		*out = make(map[string]string, len(*in))
		for key, val := range *in {
			(*out)[key] = val
		}
	} else {
		out.Annotations = nil
	}
	if in.From != nil {
		in, out := &in.From, &out.From
		*out = new(api.ObjectReference)
		// TODO: Inefficient conversion - can we improve it?
		if err := s.Convert(*in, *out, 0); err != nil {
			return err
		}
	} else {
		out.From = nil
	}
	out.Reference = in.Reference
	if in.Generation != nil {
		in, out := &in.Generation, &out.Generation
		*out = new(int64)
		**out = **in
	} else {
		out.Generation = nil
	}
	if err := Convert_v1_TagImportPolicy_To_api_TagImportPolicy(&in.ImportPolicy, &out.ImportPolicy, s); err != nil {
		return err
	}
	return nil
}
func autoConvert_v1_TagReference_To_api_TagReference(in *TagReference, out *api.TagReference, s conversion.Scope) error {
	out.Name = in.Name
	out.Annotations = in.Annotations
	if in.From != nil {
		in, out := &in.From, &out.From
		*out = new(pkg_api.ObjectReference)
		if err := api_v1.Convert_v1_ObjectReference_To_api_ObjectReference(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.From = nil
	}
	out.Reference = in.Reference
	out.Generation = in.Generation
	if err := Convert_v1_TagImportPolicy_To_api_TagImportPolicy(&in.ImportPolicy, &out.ImportPolicy, s); err != nil {
		return err
	}
	return nil
}