Skip to content

Commit 3bc3457

Browse files
authored
enhance: update FaultInjection api (#31)
* echance: fault injection in no Mesh-Real-Endpoint header case * echance: fault injection HttpMatch * fix ut * fmt logs
1 parent 59ffd7a commit 3bc3457

17 files changed

+644
-1383
lines changed

config/crd/bases/ctrlmesh.kusionstack.io_faultinjections.yaml

+26-36
Original file line numberDiff line numberDiff line change
@@ -108,50 +108,40 @@ spec:
108108
description: Match specifies a set of criterion to be met in
109109
order for the rule to be applied to the HTTP request.
110110
properties:
111-
contentMatch:
112-
description: ContentMatch
113-
items:
114-
properties:
115-
contents:
116-
description: Content is the content of the fault injection
117-
rule
118-
items:
119-
type: string
120-
type: array
121-
matchType:
122-
type: string
123-
methods:
124-
description: 'Method specifies the http method of
125-
the request, like: PUT, POST, GET, DELETE.'
126-
items:
127-
type: string
128-
type: array
129-
required:
130-
- contents
131-
- methods
132-
type: object
133-
type: array
134111
httpMatch:
135112
items:
136113
description: HttpMatch specifies the criteria for matching
137114
HTTP requests to RESTful resources as part of HTTP FaultInjection.
138115
Each rule can target one or more URLs and HTTP methods.
139116
properties:
140-
method:
141-
description: 'Method specifies the http method of
142-
the request, like: PUT, POST, GET, DELETE.'
117+
headers:
118+
description: 'TODO: header match'
143119
items:
144-
type: string
120+
properties:
121+
name:
122+
type: string
123+
value:
124+
type: string
125+
required:
126+
- name
127+
type: object
145128
type: array
146-
url:
147-
description: URL gives the location of the rest request,
148-
in standard URL form (`scheme://host:port/path`)
149-
items:
150-
type: string
151-
type: array
152-
required:
153-
- method
154-
- url
129+
host:
130+
properties:
131+
exact:
132+
type: string
133+
regex:
134+
type: string
135+
type: object
136+
method:
137+
type: string
138+
path:
139+
properties:
140+
exact:
141+
type: string
142+
regex:
143+
type: string
144+
type: object
155145
type: object
156146
type: array
157147
resources:

0 commit comments

Comments
 (0)