func ToV1Beta1IngressSpec(spec IngressSpec) v1beta1.IngressSpec {
	v1beta1Spec := v1beta1.IngressSpec{}
	v1beta1Spec.Backend = spec.Backend
	v1beta1Spec.IngressClassName = spec.IngressClassName
	v1beta1Spec.TLS = spec.TLS
	for _, v := range spec.Rules {
		rule := v1beta1.IngressRule{}
		rule.Host = v.Host
		rule.HTTP = v.HTTP
		rule.IngressRuleValue = v1beta1.IngressRuleValue{
			HTTP: v.IngressRuleValue.HTTP,
		}
		v1beta1Spec.Rules = append(v1beta1Spec.Rules, rule)
	}
	return v1beta1Spec
}
ToV1Beta1IngressSpec transforms from k8gb ingress Spec to v1beta1 ingress Spec
package v1beta1
import (
	"k8s.io/api/networking/v1beta1"
)
type IngressSpec struct {
	IngressClassName *string `json:"ingressClassName,omitempty" protobuf:"bytes,4,opt,name=ingressClassName"`
	Backend *v1beta1.IngressBackend `json:"backend,omitempty" protobuf:"bytes,1,opt,name=backend"`
	TLS []v1beta1.IngressTLS `json:"tls,omitempty" protobuf:"bytes,2,rep,name=tls"`
	Rules []IngressRule `json:"rules,omitempty" protobuf:"bytes,3,rep,name=rules"`
}
type IngressRule struct {
	Host string `json:"host,omitempty" protobuf:"bytes,1,opt,name=host"`
	IngressRuleValue `json:",inline,omitempty" protobuf:"bytes,2,opt,name=ingressRuleValue"`
}
type IngressRuleValue struct {
	HTTP *v1beta1.HTTPIngressRuleValue `json:"http" protobuf:"bytes,1,opt,name=http"`
}
func (in *IngressSpec) DeepCopyInto(out *IngressSpec) {
	*out = *in
	if in.IngressClassName != nil {
		in, out := &in.IngressClassName, &out.IngressClassName
		*out = new(string)
		**out = **in
	}
	if in.Backend != nil {
		in, out := &in.Backend, &out.Backend
		*out = new(v1beta1.IngressBackend)
		(*in).DeepCopyInto(*out)
	}
	if in.TLS != nil {
		in, out := &in.TLS, &out.TLS
		*out = make([]v1beta1.IngressTLS, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
	if in.Rules != nil {
		in, out := &in.Rules, &out.Rules
		*out = make([]IngressRule, len(*in))
		for i := range *in {
			(*in)[i].DeepCopyInto(&(*out)[i])
		}
	}
}
func (in *IngressRule) DeepCopyInto(out *IngressRule) {
	*out = *in
	in.IngressRuleValue.DeepCopyInto(&out.IngressRuleValue)
}
func (in *IngressRuleValue) DeepCopyInto(out *IngressRuleValue) {
	*out = *in
	if in.HTTP != nil {
		in, out := &in.HTTP, &out.HTTP
		*out = new(v1beta1.HTTPIngressRuleValue)
		(*in).DeepCopyInto(*out)
	}
}
func FromV1Beta1IngressSpec(v1beta1Spec v1beta1.IngressSpec) IngressSpec {
	spec := IngressSpec{}
	spec.Backend = v1beta1Spec.Backend
	spec.IngressClassName = v1beta1Spec.IngressClassName
	spec.TLS = v1beta1Spec.TLS
	for _, v := range v1beta1Spec.Rules {
		rule := IngressRule{}
		rule.Host = v.Host
		rule.HTTP = v.HTTP
		rule.IngressRuleValue = IngressRuleValue{
			HTTP: v.IngressRuleValue.HTTP,
		}
		spec.Rules = append(spec.Rules, rule)
	}
	return spec
}