コード例 #1
0
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
}
コード例 #2
0
func autoConvert_v1_RouteSpec_To_api_RouteSpec(in *RouteSpec, out *api.RouteSpec, s conversion.Scope) error {
	SetDefaults_RouteSpec(in)
	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([]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(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(api.TLSConfig)
		if err := Convert_v1_TLSConfig_To_api_TLSConfig(*in, *out, s); err != nil {
			return err
		}
	} else {
		out.TLS = nil
	}
	out.WildcardPolicy = api.WildcardPolicyType(in.WildcardPolicy)
	return nil
}