func (gs *GatewayStatus) SetDefaults() {
}
func (pm *PortMapping) SetDefaults() {
if pm.Protocol == "" {
pm.Protocol = ProtocolTCP
}
if pm.Name == "" {
pm.Name = fmt.Sprintf("%d-%d", pm.Port, pm.TargetPort)
}
}
package v1alpha2
import "cellery.io/cellery-controller/pkg/ptr"
func (g *Gateway) Default() {
	g.Spec.SetDefaults()
	g.Status.SetDefaults()
}
func (gs *GatewaySpec) SetDefaults() {
	if !gs.Ingress.IngressExtensions.HasApiPublisher() {
		for _, h := range gs.Ingress.HTTPRoutes {
			if h.Global {
				gs.Ingress.IngressExtensions.ApiPublisher = &ApiPublisherConfig{}
				return
			}
		}
	}
	gs.ScalingPolicy.SetDefaults()
}
func (sp *GwScalingPolicy) SetDefaults() {
	if sp.Hpa != nil {
		if sp.Hpa.MinReplicas == nil {
			sp.Hpa.MinReplicas = ptr.Int32(1)
		}
	}
	if sp.Hpa == nil && sp.Replicas == nil {
		sp.Replicas = ptr.Int32(1)
	}
}