Skip to content
Open
Show file tree
Hide file tree
Changes from 3 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
12 changes: 5 additions & 7 deletions pkg/agentgateway/plugins/testdata/backendpolicy/ai.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,19 +143,17 @@ output:
status:
ancestors:
- ancestorRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: test
namespace: default
group: agentgateway.dev
name: StatusSummary
conditions:
- lastTransitionTime: fake
message: Policy accepted
reason: Valid
status: "True"
type: Accepted
- lastTransitionTime: fake
message: Attached to all targets
reason: Attached
status: "True"
message: 'Policy is not attached: HTTPRoute default/test not found'
reason: Pending
status: "False"
type: Attached
controllerName: agentgateway.dev/agentgateway
12 changes: 5 additions & 7 deletions pkg/agentgateway/plugins/testdata/backendpolicy/awsauth.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,17 @@ output:
status:
ancestors:
- ancestorRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: test
namespace: default
group: agentgateway.dev
name: StatusSummary
conditions:
- lastTransitionTime: fake
message: Policy accepted
reason: Valid
status: "True"
type: Accepted
- lastTransitionTime: fake
message: Attached to all targets
reason: Attached
status: "True"
message: 'Policy is not attached: HTTPRoute default/test not found'
reason: Pending
status: "False"
type: Attached
controllerName: agentgateway.dev/agentgateway
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: agentgateway.dev/v1alpha1
kind: AgentgatewayBackend
metadata:
name: be
namespace: default
spec:
static:
host: example.com
port: 80
---
apiVersion: agentgateway.dev/v1alpha1
kind: AgentgatewayPolicy
metadata:
name: agw
namespace: default
spec:
targetRefs:
- kind: AgentgatewayBackend
name: be
group: agentgateway.dev
backend:
tls:
mtlsCertificateRef:
- name: mtls
---
# Output
output:
- Policy:
backend:
backendTls: {}
key: default/agw:tls:default/be
name:
kind: AgentgatewayPolicy
name: agw
namespace: default
target:
backend:
name: be
namespace: default
status:
ancestors:
- ancestorRef:
group: agentgateway.dev
kind: AgentgatewayBackend
name: be
namespace: default
conditions:
- lastTransitionTime: fake
message: secret default/mtls not found
reason: PartiallyValid
status: "True"
type: Accepted
controllerName: agentgateway.dev/agentgateway
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: agentgateway.dev/v1alpha1
kind: AgentgatewayPolicy
metadata:
name: agw
namespace: default
spec:
targetRefs:
- kind: AgentgatewayBackend
name: missing
group: agentgateway.dev
backend:
tls:
mtlsCertificateRef:
- name: mtls
---
# Output
output:
- Policy:
backend:
backendTls: {}
key: default/agw:tls:default/missing
name:
kind: AgentgatewayPolicy
name: agw
namespace: default
target:
backend:
name: missing
namespace: default
status:
ancestors:
- ancestorRef:
group: agentgateway.dev
name: StatusSummary
conditions:
- lastTransitionTime: fake
message: Policy accepted
reason: Valid
status: "True"
type: Accepted
- lastTransitionTime: fake
message: 'Policy is not attached: AgentgatewayBackend default/missing not found'
reason: Pending
status: "False"
type: Attached
controllerName: agentgateway.dev/agentgateway
Original file line number Diff line number Diff line change
Expand Up @@ -56,19 +56,17 @@ output:
status:
ancestors:
- ancestorRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: test
namespace: default
group: agentgateway.dev
name: StatusSummary
conditions:
- lastTransitionTime: fake
message: Policy accepted
reason: Valid
status: "True"
type: Accepted
- lastTransitionTime: fake
message: Attached to all targets
reason: Attached
status: "True"
message: 'Policy is not attached: HTTPRoute default/test not found'
reason: Pending
status: "False"
type: Attached
controllerName: agentgateway.dev/agentgateway
17 changes: 9 additions & 8 deletions pkg/agentgateway/plugins/testdata/backendpolicy/simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,17 @@ output:
status:
ancestors:
- ancestorRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
name: test
namespace: default
group: agentgateway.dev
name: StatusSummary
conditions:
- lastTransitionTime: fake
message: |-
ConfigMap default/ca-bundle not found
secret default/hello not found
reason: PartiallyValid
message: Policy accepted
reason: Valid
status: "True"
type: Accepted
- lastTransitionTime: fake
message: 'Policy is not attached: HTTPRoute default/test not found'
reason: Pending
status: "False"
type: Attached
controllerName: agentgateway.dev/agentgateway
62 changes: 62 additions & 0 deletions pkg/agentgateway/plugins/testdata/frontendpolicy/tls-listener.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: test
namespace: default
spec:
gatewayClassName: dummy
listeners:
- name: https
protocol: HTTPS
port: 443
---
apiVersion: agentgateway.dev/v1alpha1
kind: AgentgatewayPolicy
metadata:
name: tls-policy
namespace: default
spec:
targetRefs:
- kind: Gateway
name: test
group: gateway.networking.k8s.io
sectionName: https
frontend:
tls:
handshakeTimeout: 15s
---
# Output
output:
- Policy:
frontend:
tls:
handshakeTimeout: 15s
key: frontend/default/tls-policy:frontend-tls:default/test/https
name:
kind: AgentgatewayPolicy
name: tls-policy
namespace: default
target:
gateway:
listener: https
name: test
namespace: default
status:
ancestors:
- ancestorRef:
group: gateway.networking.k8s.io
kind: Gateway
name: test
namespace: default
conditions:
- lastTransitionTime: fake
message: Policy accepted
reason: Valid
status: "True"
type: Accepted
- lastTransitionTime: fake
message: Attached to all targets
reason: Attached
status: "True"
type: Attached
controllerName: agentgateway.dev/agentgateway
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: gw
namespace: default
spec:
gatewayClassName: agentgateway
listeners:
- protocol: HTTP
port: 8080
name: http
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: r
namespace: default
spec:
parentRefs:
- name: gw
rules:
- backendRefs:
- name: example-svc
port: 8080
---
apiVersion: v1
kind: Service
metadata:
name: example-svc
namespace: default
spec:
ports:
- name: http
port: 8080
targetPort: 8080
---
apiVersion: agentgateway.dev/v1alpha1
kind: AgentgatewayPolicy
metadata:
name: agw
namespace: default
spec:
targetRefs:
- kind: HTTPRoute
name: r
group: gateway.networking.k8s.io
traffic:
timeouts:
request: 5s
---
# Output
output:
- Policy:
key: traffic/default/agw:timeout:default/r
name:
kind: AgentgatewayPolicy
name: agw
namespace: default
target:
route:
name: r
namespace: default
traffic:
timeout:
request: 5s
status:
ancestors:
- ancestorRef:
group: gateway.networking.k8s.io
kind: Gateway
name: gw
namespace: default
conditions:
- lastTransitionTime: fake
message: Policy accepted
reason: Valid
status: "True"
type: Accepted
- lastTransitionTime: fake
message: Attached to all targets
reason: Attached
status: "True"
type: Attached
controllerName: agentgateway.dev/agentgateway
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
apiVersion: agentgateway.dev/v1alpha1
kind: AgentgatewayPolicy
metadata:
name: agw
namespace: default
spec:
targetRefs:
- kind: HTTPRoute
name: missing
group: gateway.networking.k8s.io
traffic:
timeouts:
request: 5s
---
# Output
output:
- Policy:
key: traffic/default/agw:timeout:default/missing
name:
kind: AgentgatewayPolicy
name: agw
namespace: default
target:
route:
name: missing
namespace: default
traffic:
timeout:
request: 5s
status:
ancestors:
- ancestorRef:
group: agentgateway.dev
name: StatusSummary
conditions:
- lastTransitionTime: fake
message: Policy accepted
reason: Valid
status: "True"
type: Accepted
- lastTransitionTime: fake
message: 'Policy is not attached: HTTPRoute default/missing not found'
reason: Pending
status: "False"
type: Attached
controllerName: agentgateway.dev/agentgateway
Loading
Loading