diff --git a/apis/networking/v1beta1/gatewayserver_types.go b/apis/networking/v1beta1/gatewayserver_types.go index d5de0e75fe..f5f4b35b03 100644 --- a/apis/networking/v1beta1/gatewayserver_types.go +++ b/apis/networking/v1beta1/gatewayserver_types.go @@ -66,6 +66,7 @@ type GatewayServerSpec struct { } // EndpointStatus defines the observed state of the endpoint. +// +kubebuilder:validation:XValidation:rule="!(has(self.port)&&has(self.ports)&&self.port!=self.ports[0])",message="port must match ports[0]" type EndpointStatus struct { // Addresses specifies the addresses of the endpoint. Addresses []string `json:"addresses,omitempty"` @@ -74,6 +75,9 @@ type EndpointStatus struct { // Protocol specifies the protocol of the endpoint. // +kubebuilder:validation:Enum=TCP;UDP Protocol *corev1.Protocol `json:"protocol,omitempty"` + // Ports specifies the ports of the endpoint. + // This field is preferred over the legacy Port field, which is kept for backward compatibility. + Ports []int32 `json:"ports,omitempty"` } // InternalGatewayEndpoint defines the endpoint for the internal network. diff --git a/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_gatewayclients.yaml b/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_gatewayclients.yaml index 513edc0a67..4050b9422b 100644 --- a/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_gatewayclients.yaml +++ b/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_gatewayclients.yaml @@ -130,6 +130,14 @@ spec: description: Port specifies the port of the endpoint. format: int32 type: integer + ports: + description: |- + Ports specifies the ports of the endpoint. + This field is preferred over the legacy Port field, which is kept for backward compatibility. + items: + format: int32 + type: integer + type: array protocol: description: Protocol specifies the protocol of the endpoint. enum: @@ -137,6 +145,9 @@ spec: - UDP type: string type: object + x-kubernetes-validations: + - message: port must match ports[0] + rule: '!(has(self.port)&&has(self.ports)&&self.port!=self.ports[0])' mtu: description: MTU specifies the MTU of the tunnel. type: integer diff --git a/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_gatewayservers.yaml b/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_gatewayservers.yaml index 9e953d1d35..ff7fda3d42 100644 --- a/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_gatewayservers.yaml +++ b/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_gatewayservers.yaml @@ -180,6 +180,14 @@ spec: description: Port specifies the port of the endpoint. format: int32 type: integer + ports: + description: |- + Ports specifies the ports of the endpoint. + This field is preferred over the legacy Port field, which is kept for backward compatibility. + items: + format: int32 + type: integer + type: array protocol: description: Protocol specifies the protocol of the endpoint. enum: @@ -187,6 +195,9 @@ spec: - UDP type: string type: object + x-kubernetes-validations: + - message: port must match ports[0] + rule: '!(has(self.port)&&has(self.ports)&&self.port!=self.ports[0])' internalEndpoint: description: InternalEndpoint specifies the endpoint for the internal network. diff --git a/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_wggatewayservers.yaml b/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_wggatewayservers.yaml index 319c89bf73..21ed20801a 100644 --- a/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_wggatewayservers.yaml +++ b/deployments/liqo/charts/liqo-crds/crds/networking.liqo.io_wggatewayservers.yaml @@ -10447,6 +10447,14 @@ spec: description: Port specifies the port of the endpoint. format: int32 type: integer + ports: + description: |- + Ports specifies the ports of the endpoint. + This field is preferred over the legacy Port field, which is kept for backward compatibility. + items: + format: int32 + type: integer + type: array protocol: description: Protocol specifies the protocol of the endpoint. enum: @@ -10454,6 +10462,9 @@ spec: - UDP type: string type: object + x-kubernetes-validations: + - message: port must match ports[0] + rule: '!(has(self.port)&&has(self.ports)&&self.port!=self.ports[0])' internalEndpoint: description: InternalEndpoint specifies the endpoint for the internal network.