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:
|
spec:
|
||||||
routes:
|
routes:
|
||||||
- condition:
|
- condition:
|
||||||
path_regex: "/x/y/z"
|
pathRegex: "/x/y/z"
|
||||||
response_classes:
|
responseClasses:
|
||||||
- condition:
|
- condition:
|
||||||
status:
|
status:
|
||||||
min: 500
|
min: 500
|
||||||
is_failure: true`,
|
isFailure: true`,
|
||||||
},
|
},
|
||||||
service: profileId{namespace: "linkerd", name: "foobar.ns.svc.cluster.local"},
|
service: profileId{namespace: "linkerd", name: "foobar.ns.svc.cluster.local"},
|
||||||
expectedProfiles: []*sp.ServiceProfileSpec{
|
expectedProfiles: []*sp.ServiceProfileSpec{
|
||||||
|
|
|
@ -32,20 +32,20 @@ type ServiceProfileSpec struct {
|
||||||
type RouteSpec struct {
|
type RouteSpec struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Condition *RequestMatch `json:"condition"`
|
Condition *RequestMatch `json:"condition"`
|
||||||
ResponseClasses []*ResponseClass `json:"response_classes,omitempty"`
|
ResponseClasses []*ResponseClass `json:"responseClasses,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestMatch struct {
|
type RequestMatch struct {
|
||||||
All []*RequestMatch `json:"all,omitempty"`
|
All []*RequestMatch `json:"all,omitempty"`
|
||||||
Not *RequestMatch `json:"not,omitempty"`
|
Not *RequestMatch `json:"not,omitempty"`
|
||||||
Any []*RequestMatch `json:"any,omitempty"`
|
Any []*RequestMatch `json:"any,omitempty"`
|
||||||
PathRegex string `json:"path_regex,omitempty"`
|
PathRegex string `json:"pathRegex,omitempty"`
|
||||||
Method string `json:"method,omitempty"`
|
Method string `json:"method,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResponseClass struct {
|
type ResponseClass struct {
|
||||||
Condition *ResponseMatch `json:"condition"`
|
Condition *ResponseMatch `json:"condition"`
|
||||||
IsFailure bool `json:"is_failure,omitempty"`
|
IsFailure bool `json:"isFailure,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResponseMatch struct {
|
type ResponseMatch struct {
|
||||||
|
|
|
@ -18,7 +18,7 @@ spec:
|
||||||
# matches more than one route, the first match wins.
|
# matches more than one route, the first match wins.
|
||||||
condition:
|
condition:
|
||||||
# The simplest condition is a path regular expression.
|
# The simplest condition is a path regular expression.
|
||||||
path_regex: '/authors/\d+'
|
pathRegex: '/authors/\d+'
|
||||||
|
|
||||||
# This is a condition that checks the request method.
|
# This is a condition that checks the request method.
|
||||||
method: POST
|
method: POST
|
||||||
|
@ -26,22 +26,22 @@ spec:
|
||||||
# If more than one condition field is set, all of them must be satisfied.
|
# If more than one condition field is set, all of them must be satisfied.
|
||||||
# This is equivalent to using the 'all' condition:
|
# This is equivalent to using the 'all' condition:
|
||||||
# all:
|
# all:
|
||||||
# - path_regex: '/authors/\d+'
|
# - pathRegex: '/authors/\d+'
|
||||||
# - method: POST
|
# - method: POST
|
||||||
|
|
||||||
# Conditions can be combined using 'all', 'any', and 'not'.
|
# Conditions can be combined using 'all', 'any', and 'not'.
|
||||||
# any:
|
# any:
|
||||||
# - all:
|
# - all:
|
||||||
# - method: POST
|
# - method: POST
|
||||||
# - path_regex: '/authors/\d+'
|
# - pathRegex: '/authors/\d+'
|
||||||
# - all:
|
# - all:
|
||||||
# - not:
|
# - not:
|
||||||
# method: DELETE
|
# method: DELETE
|
||||||
# - path_regex: /info.txt
|
# - pathRegex: /info.txt
|
||||||
|
|
||||||
# A route may optionally define a list of response classes which describe
|
# A route may optionally define a list of response classes which describe
|
||||||
# how responses from this route will be classified.
|
# how responses from this route will be classified.
|
||||||
response_classes:
|
responseClasses:
|
||||||
|
|
||||||
# Each response class must define a condition. All responses from this
|
# Each response class must define a condition. All responses from this
|
||||||
# route that match the condition will be classified as this response class.
|
# 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
|
# The response class defines whether responses should be counted as
|
||||||
# successes or failures.
|
# successes or failures.
|
||||||
is_failure: true
|
isFailure: true
|
||||||
`
|
`
|
||||||
|
|
Loading…
Reference in New Issue