diff --git a/api/v1alpha1/backend_types.go b/api/v1alpha1/backend_types.go index 8ea958bfa1d..c6665bae953 100644 --- a/api/v1alpha1/backend_types.go +++ b/api/v1alpha1/backend_types.go @@ -123,12 +123,12 @@ type UnixSocket struct { // // +notImplementedHide type BackendSpec struct { - // BackendEndpoints defines the endpoints to be used when connecting to the backend. + // Endpoints defines the endpoints to be used when connecting to the backend. // // +kubebuilder:validation:MinItems=1 // +kubebuilder:validation:MaxItems=4 // +kubebuilder:validation:XValidation:rule="self.all(f, has(f.fqdn)) || !self.exists(f, has(f.fqdn))",message="fqdn addresses cannot be mixed with other address types" - BackendEndpoints []BackendEndpoint `json:"endpoints,omitempty"` + Endpoints []BackendEndpoint `json:"endpoints,omitempty"` // AppProtocols defines the application protocols to be supported when connecting to the backend. // diff --git a/api/v1alpha1/zz_generated.deepcopy.go b/api/v1alpha1/zz_generated.deepcopy.go index f1338b90b28..3c046e25386 100644 --- a/api/v1alpha1/zz_generated.deepcopy.go +++ b/api/v1alpha1/zz_generated.deepcopy.go @@ -311,8 +311,8 @@ func (in *BackendRef) DeepCopy() *BackendRef { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *BackendSpec) DeepCopyInto(out *BackendSpec) { *out = *in - if in.BackendEndpoints != nil { - in, out := &in.BackendEndpoints, &out.BackendEndpoints + if in.Endpoints != nil { + in, out := &in.Endpoints, &out.Endpoints *out = make([]BackendEndpoint, len(*in)) for i := range *in { (*in)[i].DeepCopyInto(&(*out)[i]) diff --git a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backends.yaml b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backends.yaml index 360bcfbddb1..68c1324ed82 100644 --- a/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backends.yaml +++ b/charts/gateway-helm/crds/generated/gateway.envoyproxy.io_backends.yaml @@ -65,8 +65,8 @@ spec: type: string type: array endpoints: - description: BackendEndpoints defines the endpoints to be used when - connecting to the backend. + description: Endpoints defines the endpoints to be used when connecting + to the backend. items: description: |- BackendEndpoint describes a backend endpoint, which can be either a fully-qualified domain name, IPv4 address or unix domain socket diff --git a/site/content/en/latest/api/extension_types.md b/site/content/en/latest/api/extension_types.md index 3b83c297406..f94e5a61aea 100644 --- a/site/content/en/latest/api/extension_types.md +++ b/site/content/en/latest/api/extension_types.md @@ -303,7 +303,7 @@ _Appears in:_ | Field | Type | Required | Description | | --- | --- | --- | --- | -| `endpoints` | _[BackendEndpoint](#backendendpoint) array_ | true | BackendEndpoints defines the endpoints to be used when connecting to the backend. | +| `endpoints` | _[BackendEndpoint](#backendendpoint) array_ | true | Endpoints defines the endpoints to be used when connecting to the backend. | | `appProtocols` | _[AppProtocolType](#appprotocoltype) array_ | false | AppProtocols defines the application protocols to be supported when connecting to the backend. | diff --git a/test/cel-validation/backend_test.go b/test/cel-validation/backend_test.go index 791692e9482..b9c0b7853af 100644 --- a/test/cel-validation/backend_test.go +++ b/test/cel-validation/backend_test.go @@ -41,7 +41,7 @@ func TestBackend(t *testing.T) { mutate: func(backend *egv1a1.Backend) { backend.Spec = egv1a1.BackendSpec{ AppProtocols: []egv1a1.AppProtocolType{egv1a1.AppProtocolTypeH2C}, - BackendEndpoints: []egv1a1.BackendEndpoint{ + Endpoints: []egv1a1.BackendEndpoint{ { Unix: &egv1a1.UnixSocket{ Path: "/path/to/service.sock", @@ -63,7 +63,7 @@ func TestBackend(t *testing.T) { mutate: func(backend *egv1a1.Backend) { backend.Spec = egv1a1.BackendSpec{ AppProtocols: []egv1a1.AppProtocolType{egv1a1.AppProtocolTypeH2C}, - BackendEndpoints: []egv1a1.BackendEndpoint{ + Endpoints: []egv1a1.BackendEndpoint{ { FQDN: &egv1a1.FQDNEndpoint{ Address: "example.com", @@ -86,7 +86,7 @@ func TestBackend(t *testing.T) { mutate: func(backend *egv1a1.Backend) { backend.Spec = egv1a1.BackendSpec{ AppProtocols: []egv1a1.AppProtocolType{"HTTP7"}, - BackendEndpoints: []egv1a1.BackendEndpoint{ + Endpoints: []egv1a1.BackendEndpoint{ { FQDN: &egv1a1.FQDNEndpoint{ Address: "example.com", @@ -102,8 +102,8 @@ func TestBackend(t *testing.T) { desc: "No address", mutate: func(backend *egv1a1.Backend) { backend.Spec = egv1a1.BackendSpec{ - AppProtocols: []egv1a1.AppProtocolType{egv1a1.AppProtocolTypeH2C}, - BackendEndpoints: []egv1a1.BackendEndpoint{{}}, + AppProtocols: []egv1a1.AppProtocolType{egv1a1.AppProtocolTypeH2C}, + Endpoints: []egv1a1.BackendEndpoint{{}}, } }, wantErrors: []string{"spec.endpoints[0]: Invalid value: \"object\": one of fqdn, ipv4 or unix must be specified"}, @@ -113,7 +113,7 @@ func TestBackend(t *testing.T) { mutate: func(backend *egv1a1.Backend) { backend.Spec = egv1a1.BackendSpec{ AppProtocols: []egv1a1.AppProtocolType{egv1a1.AppProtocolTypeH2C}, - BackendEndpoints: []egv1a1.BackendEndpoint{ + Endpoints: []egv1a1.BackendEndpoint{ { FQDN: &egv1a1.FQDNEndpoint{ Address: "example.com", @@ -133,7 +133,7 @@ func TestBackend(t *testing.T) { mutate: func(backend *egv1a1.Backend) { backend.Spec = egv1a1.BackendSpec{ AppProtocols: []egv1a1.AppProtocolType{egv1a1.AppProtocolTypeH2C}, - BackendEndpoints: []egv1a1.BackendEndpoint{ + Endpoints: []egv1a1.BackendEndpoint{ { FQDN: &egv1a1.FQDNEndpoint{ Address: "example.com", @@ -156,7 +156,7 @@ func TestBackend(t *testing.T) { mutate: func(backend *egv1a1.Backend) { backend.Spec = egv1a1.BackendSpec{ AppProtocols: []egv1a1.AppProtocolType{egv1a1.AppProtocolTypeH2C}, - BackendEndpoints: []egv1a1.BackendEndpoint{ + Endpoints: []egv1a1.BackendEndpoint{ { FQDN: &egv1a1.FQDNEndpoint{ Address: "host name", @@ -196,7 +196,7 @@ func TestBackend(t *testing.T) { mutate: func(backend *egv1a1.Backend) { backend.Spec = egv1a1.BackendSpec{ AppProtocols: []egv1a1.AppProtocolType{egv1a1.AppProtocolTypeH2C}, - BackendEndpoints: []egv1a1.BackendEndpoint{ + Endpoints: []egv1a1.BackendEndpoint{ { IPv4: &egv1a1.IPv4Endpoint{ Address: "300.0.0.0",