Esempio n. 1
0
func autoConvert_v1_RouteSpec_To_api_RouteSpec(in *RouteSpec, out *route_api.RouteSpec, s conversion.Scope) error {
	if defaulting, found := s.DefaultingInterface(reflect.TypeOf(*in)); found {
		defaulting.(func(*RouteSpec))(in)
	}
	out.Host = in.Host
	out.Path = in.Path
	// TODO: Inefficient conversion - can we improve it?
	if err := s.Convert(&in.To, &out.To, 0); err != nil {
		return err
	}
	if in.Port != nil {
		in, out := &in.Port, &out.Port
		*out = new(route_api.RoutePort)
		if err := Convert_v1_RoutePort_To_api_RoutePort(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.Port = nil
	}
	if in.TLS != nil {
		in, out := &in.TLS, &out.TLS
		*out = new(route_api.TLSConfig)
		if err := Convert_v1_TLSConfig_To_api_TLSConfig(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.TLS = nil
	}
	return nil
}
Esempio n. 2
0
func autoConvert_v1_RouteSpec_To_api_RouteSpec(in *RouteSpec, out *route_api.RouteSpec, s conversion.Scope) error {
	SetDefaults_RouteSpec(in)
	out.Host = in.Host
	out.Path = in.Path
	// TODO: Inefficient conversion - can we improve it?
	if err := s.Convert(&in.To, &out.To, 0); err != nil {
		return err
	}
	if in.Port != nil {
		in, out := &in.Port, &out.Port
		*out = new(route_api.RoutePort)
		if err := Convert_v1_RoutePort_To_api_RoutePort(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.Port = nil
	}
	if in.TLS != nil {
		in, out := &in.TLS, &out.TLS
		*out = new(route_api.TLSConfig)
		if err := Convert_v1_TLSConfig_To_api_TLSConfig(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.TLS = nil
	}
	return nil
}
Esempio n. 3
0
func autoConvert_v1_RouteSpec_To_api_RouteSpec(in *RouteSpec, out *route_api.RouteSpec, s conversion.Scope) error {
	out.Host = in.Host
	out.Path = in.Path
	if err := Convert_v1_RouteTargetReference_To_api_RouteTargetReference(&in.To, &out.To, s); err != nil {
		return err
	}
	if in.AlternateBackends != nil {
		in, out := &in.AlternateBackends, &out.AlternateBackends
		*out = make([]route_api.RouteTargetReference, len(*in))
		for i := range *in {
			if err := Convert_v1_RouteTargetReference_To_api_RouteTargetReference(&(*in)[i], &(*out)[i], s); err != nil {
				return err
			}
		}
	} else {
		out.AlternateBackends = nil
	}
	if in.Port != nil {
		in, out := &in.Port, &out.Port
		*out = new(route_api.RoutePort)
		if err := Convert_v1_RoutePort_To_api_RoutePort(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.Port = nil
	}
	if in.TLS != nil {
		in, out := &in.TLS, &out.TLS
		*out = new(route_api.TLSConfig)
		if err := Convert_v1_TLSConfig_To_api_TLSConfig(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.TLS = nil
	}
	return nil
}
func autoConvert_v1_RouteSpec_To_api_RouteSpec(in *RouteSpec, out *api.RouteSpec, s conversion.Scope) error {
	out.Host = in.Host
	out.Path = in.Path
	if err := Convert_v1_RouteTargetReference_To_api_RouteTargetReference(&in.To, &out.To, s); err != nil {
		return err
	}
	out.AlternateBackends = *(*[]api.RouteTargetReference)(unsafe.Pointer(&in.AlternateBackends))
	out.Port = (*api.RoutePort)(unsafe.Pointer(in.Port))
	out.TLS = (*api.TLSConfig)(unsafe.Pointer(in.TLS))
	out.WildcardPolicy = api.WildcardPolicyType(in.WildcardPolicy)
	return nil
}