-
Notifications
You must be signed in to change notification settings - Fork 590
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(tests): introduce isolated TestHTTPRouteWithBrokenPluginFallback (
- Loading branch information
1 parent
c24305a
commit 5cefa9a
Showing
5 changed files
with
343 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
# This configuration file presents fallback configuration (feature gate FallbackConfiguration=true), | ||
# it contains a plugin that is misconfigured and will not work. The whole route /for-auth-users won't | ||
# be configured. Only the route /httproute-testing will be configured. | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: echo-1 | ||
labels: | ||
app: echo-1 | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: echo-1 | ||
template: | ||
metadata: | ||
labels: | ||
app: echo-1 | ||
spec: | ||
containers: | ||
- name: echo-1 | ||
image: kong/go-echo:0.3.0 | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
ports: | ||
- containerPort: 80 | ||
resources: | ||
limits: | ||
memory: "64Mi" | ||
cpu: "250m" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: echo-1 | ||
name: echo-1 | ||
spec: | ||
ports: | ||
- port: 80 | ||
protocol: TCP | ||
targetPort: 1027 | ||
selector: | ||
app: echo-1 | ||
type: ClusterIP | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: echo-2 | ||
labels: | ||
app: echo-2 | ||
spec: | ||
selector: | ||
matchLabels: | ||
app: echo-2 | ||
template: | ||
metadata: | ||
labels: | ||
app: echo-2 | ||
spec: | ||
containers: | ||
- name: echo-2 | ||
image: kong/go-echo:0.3.0 | ||
env: | ||
- name: POD_NAME | ||
valueFrom: | ||
fieldRef: | ||
fieldPath: metadata.name | ||
ports: | ||
- containerPort: 80 | ||
resources: | ||
limits: | ||
memory: "64Mi" | ||
cpu: "250m" | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
labels: | ||
app: echo-2 | ||
name: echo-2 | ||
spec: | ||
ports: | ||
- port: 8080 | ||
protocol: TCP | ||
targetPort: 1027 | ||
selector: | ||
app: echo-2 | ||
type: ClusterIP | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: GatewayClass | ||
metadata: | ||
name: kong | ||
annotations: | ||
konghq.com/gatewayclass-unmanaged: "true" | ||
spec: | ||
controllerName: konghq.com/kic-gateway-controller | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: Gateway | ||
metadata: | ||
name: kong | ||
spec: | ||
gatewayClassName: kong | ||
listeners: | ||
- name: http | ||
protocol: HTTP | ||
port: 80 | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: httproute-testing | ||
annotations: | ||
konghq.com/strip-path: "true" | ||
spec: | ||
parentRefs: | ||
- name: kong | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: /httproute-testing | ||
backendRefs: | ||
- name: echo-1 | ||
kind: Service | ||
port: 80 | ||
weight: 75 | ||
- name: echo-2 | ||
kind: Service | ||
port: 8080 | ||
weight: 25 | ||
--- | ||
apiVersion: gateway.networking.k8s.io/v1 | ||
kind: HTTPRoute | ||
metadata: | ||
name: httproute-testing2 | ||
annotations: | ||
konghq.com/strip-path: "true" | ||
konghq.com/plugins: key-auth | ||
spec: | ||
parentRefs: | ||
- name: kong | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: /for-auth-users | ||
backendRefs: | ||
- name: echo-1 | ||
kind: Service | ||
port: 80 | ||
weight: 75 | ||
- name: echo-2 | ||
kind: Service | ||
port: 8080 | ||
weight: 25 | ||
--- | ||
apiVersion: configuration.konghq.com/v1 | ||
kind: KongPlugin | ||
metadata: | ||
name: key-auth | ||
namespace: default | ||
plugin: key-auth | ||
config: | ||
# Should be key_names, not keys. | ||
keys: ["key"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.