Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions api/v1alpha1/backend_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ type FQDNEndpoint struct {
// https://www.envoyproxy.io/docs/envoy/latest/api-v3/config/core/v3/address.proto#config-core-v3-pipe
type UnixSocket struct {
// Path defines the unix domain socket path of the backend endpoint.
// The path length must not exceed 108 characters.
//
// +kubebuilder:validation:MaxLength=108
Path string `json:"path"`
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ spec:
description: Unix defines the unix domain socket endpoint
properties:
path:
description: Path defines the unix domain socket path of
the backend endpoint.
description: |-
Path defines the unix domain socket path of the backend endpoint.
The path length must not exceed 108 characters.
maxLength: 108
type: string
required:
- path
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@ spec:
description: Unix defines the unix domain socket endpoint
properties:
path:
description: Path defines the unix domain socket path of
the backend endpoint.
description: |-
Path defines the unix domain socket path of the backend endpoint.
The path length must not exceed 108 characters.
maxLength: 108
type: string
required:
- path
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 @@ -4757,7 +4757,7 @@ _Appears in:_

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `path` | _string_ | true | | Path defines the unix domain socket path of the backend endpoint. |
| `path` | _string_ | true | | Path defines the unix domain socket path of the backend endpoint.<br />The path length must not exceed 108 characters. |


#### Wasm
Expand Down
16 changes: 16 additions & 0 deletions test/cel-validation/backend_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,22 @@ func TestBackend(t *testing.T) {
},
wantErrors: []string{"TLS settings can only be specified for DynamicResolver backends"},
},
{
desc: "Invalid Unix socket path length",
mutate: func(backend *egv1a1.Backend) {
backend.Spec = egv1a1.BackendSpec{
AppProtocols: []egv1a1.AppProtocolType{egv1a1.AppProtocolTypeH2C},
Endpoints: []egv1a1.BackendEndpoint{
{
Unix: &egv1a1.UnixSocket{
Path: "/path/to/a/very/long/unix/socket/path/that/exceeds/the/maximum/allowed/length/of/108/characters/and/should/fail/validation.sock",
},
},
},
}
},
wantErrors: []string{"spec.endpoints[0].unix.path: Too long: may not be more than 108 bytes"},
},
}

for _, tc := range cases {
Expand Down
6 changes: 4 additions & 2 deletions test/helm/gateway-crds-helm/all.out.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17431,8 +17431,10 @@ spec:
description: Unix defines the unix domain socket endpoint
properties:
path:
description: Path defines the unix domain socket path of
the backend endpoint.
description: |-
Path defines the unix domain socket path of the backend endpoint.
The path length must not exceed 108 characters.
maxLength: 108
type: string
required:
- path
Expand Down
6 changes: 4 additions & 2 deletions test/helm/gateway-crds-helm/envoy-gateway-crds.out.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,10 @@ spec:
description: Unix defines the unix domain socket endpoint
properties:
path:
description: Path defines the unix domain socket path of
the backend endpoint.
description: |-
Path defines the unix domain socket path of the backend endpoint.
The path length must not exceed 108 characters.
maxLength: 108
type: string
required:
- path
Expand Down