Skip to content

Commit

Permalink
rename backendendpoints => endpoits
Browse files Browse the repository at this point in the history
Signed-off-by: Guy Daich <guy.daich@sap.com>
  • Loading branch information
guydc committed May 14, 2024
1 parent 7833963 commit 0f6aee8
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions api/v1alpha1/backend_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
//
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion site/content/en/latest/api/extension_types.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |


Expand Down
18 changes: 9 additions & 9 deletions test/cel-validation/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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"},
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 0f6aee8

Please sign in to comment.