From e751217905122b31713e6c6cb1afb6348a8dcc1f Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Tue, 21 Jan 2025 13:37:24 -0800 Subject: [PATCH] api: make AIGatewayRouteRuleBackendRef.Weight default to match GWAPI Signed-off-by: Takeshi Yoneda --- api/v1alpha1/api.go | 7 +++++-- .../crds/aigateway.envoyproxy.io_aigatewayroutes.yaml | 4 +++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/api/v1alpha1/api.go b/api/v1alpha1/api.go index 3d7e598b..0e294d11 100644 --- a/api/v1alpha1/api.go +++ b/api/v1alpha1/api.go @@ -207,9 +207,12 @@ type AIGatewayRouteRuleBackendRef struct { // the BackendRef in the Gateway API. See for the details: // https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.BackendRef // - // +kubebuilder:validation:Required + // Default is 1. + // + // +optional // +kubebuilder:validation:Minimum=0 - Weight int `json:"weight"` + // +kubebuilder:default=1 + Weight int `json:"weight,omitempty"` } type AIGatewayRouteRuleMatch struct { diff --git a/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_aigatewayroutes.yaml b/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_aigatewayroutes.yaml index 038df7dd..7c3e04fc 100644 --- a/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_aigatewayroutes.yaml +++ b/manifests/charts/ai-gateway-helm/crds/aigateway.envoyproxy.io_aigatewayroutes.yaml @@ -254,15 +254,17 @@ spec: minLength: 1 type: string weight: + default: 1 description: |- Weight is the weight of the AIServiceBackend. This is exactly the same as the weight in the BackendRef in the Gateway API. See for the details: https://gateway-api.sigs.k8s.io/reference/spec/#gateway.networking.k8s.io%2fv1.BackendRef + + Default is 1. minimum: 0 type: integer required: - name - - weight type: object maxItems: 128 type: array