Skip to content

Commit 2e8b51b

Browse files
authored
Cooperate/GitHub chunqi faultinjection (#29)
* fix:fix circuit breaker update condition * fix:fix circuit and fault store update * feat: add fault normal and regexp rules
1 parent 7efa14b commit 2e8b51b

File tree

16 files changed

+857
-201
lines changed

16 files changed

+857
-201
lines changed

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

+23
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,29 @@ 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
111134
httpMatch:
112135
items:
113136
description: HttpMatch specifies the criteria for matching

pkg/apis/ctrlmesh/constants/constants.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ const (
6363
EnvEnableSim = "ENABLE_SIM"
6464

6565
EnvDisableCircuitBreaker = "DISABLE_CIRCUIT_BREAKER"
66-
EnvDisableFaultInjection = "DISABLE_FAULT_INJECTION"
66+
EnvEnableFaultInjection = "ENABLE_FAULT_INJECTION"
6767
EnvEnableApiServerCircuitBreaker = "ENABLE_API_SERVER_BREAKER"
6868
EnvEnableRestCircuitBreaker = "ENABLE_REST_BREAKER"
6969
EnvEnableRestFaultInjection = "ENABLE_REST_FAULT_INJECTION"
@@ -77,6 +77,7 @@ func AllProxySyncEnvKey() []string {
7777
EnvIPTable,
7878
EnvEnableWebHookProxy,
7979
EnvDisableCircuitBreaker,
80+
EnvEnableFaultInjection,
8081
EnvEnableApiServerCircuitBreaker,
8182
EnvEnableRestCircuitBreaker,
8283
EnvEnableRestFaultInjection,

0 commit comments

Comments
 (0)