mirror of https://github.com/linkerd/linkerd2.git
Rename path_regex to pathRegex (#1951)
Rename snake case fields to camel case in service profile spec. This improves the way they are rendered when the `kubectl describe` command is used. Signed-off-by: Alex Leong <alex@buoyant.io>
This commit is contained in:
parent
f553372e66
commit
04ed200e36
|
@ -26,12 +26,12 @@ metadata:
|
|||
spec:
|
||||
routes:
|
||||
- condition:
|
||||
path_regex: "/x/y/z"
|
||||
response_classes:
|
||||
pathRegex: "/x/y/z"
|
||||
responseClasses:
|
||||
- condition:
|
||||
status:
|
||||
min: 500
|
||||
is_failure: true`,
|
||||
isFailure: true`,
|
||||
},
|
||||
service: profileId{namespace: "linkerd", name: "foobar.ns.svc.cluster.local"},
|
||||
expectedProfiles: []*sp.ServiceProfileSpec{
|
||||
|
|
|
@ -32,20 +32,20 @@ type ServiceProfileSpec struct {
|
|||
type RouteSpec struct {
|
||||
Name string `json:"name"`
|
||||
Condition *RequestMatch `json:"condition"`
|
||||
ResponseClasses []*ResponseClass `json:"response_classes,omitempty"`
|
||||
ResponseClasses []*ResponseClass `json:"responseClasses,omitempty"`
|
||||
}
|
||||
|
||||
type RequestMatch struct {
|
||||
All []*RequestMatch `json:"all,omitempty"`
|
||||
Not *RequestMatch `json:"not,omitempty"`
|
||||
Any []*RequestMatch `json:"any,omitempty"`
|
||||
PathRegex string `json:"path_regex,omitempty"`
|
||||
PathRegex string `json:"pathRegex,omitempty"`
|
||||
Method string `json:"method,omitempty"`
|
||||
}
|
||||
|
||||
type ResponseClass struct {
|
||||
Condition *ResponseMatch `json:"condition"`
|
||||
IsFailure bool `json:"is_failure,omitempty"`
|
||||
IsFailure bool `json:"isFailure,omitempty"`
|
||||
}
|
||||
|
||||
type ResponseMatch struct {
|
||||
|
|
|
@ -18,7 +18,7 @@ spec:
|
|||
# matches more than one route, the first match wins.
|
||||
condition:
|
||||
# The simplest condition is a path regular expression.
|
||||
path_regex: '/authors/\d+'
|
||||
pathRegex: '/authors/\d+'
|
||||
|
||||
# This is a condition that checks the request method.
|
||||
method: POST
|
||||
|
@ -26,22 +26,22 @@ spec:
|
|||
# If more than one condition field is set, all of them must be satisfied.
|
||||
# This is equivalent to using the 'all' condition:
|
||||
# all:
|
||||
# - path_regex: '/authors/\d+'
|
||||
# - pathRegex: '/authors/\d+'
|
||||
# - method: POST
|
||||
|
||||
# Conditions can be combined using 'all', 'any', and 'not'.
|
||||
# any:
|
||||
# - all:
|
||||
# - method: POST
|
||||
# - path_regex: '/authors/\d+'
|
||||
# - pathRegex: '/authors/\d+'
|
||||
# - all:
|
||||
# - not:
|
||||
# method: DELETE
|
||||
# - path_regex: /info.txt
|
||||
# - pathRegex: /info.txt
|
||||
|
||||
# A route may optionally define a list of response classes which describe
|
||||
# how responses from this route will be classified.
|
||||
response_classes:
|
||||
responseClasses:
|
||||
|
||||
# Each response class must define a condition. All responses from this
|
||||
# route that match the condition will be classified as this response class.
|
||||
|
@ -66,5 +66,5 @@ spec:
|
|||
|
||||
# The response class defines whether responses should be counted as
|
||||
# successes or failures.
|
||||
is_failure: true
|
||||
isFailure: true
|
||||
`
|
||||
|
|
Loading…
Reference in New Issue