diff --git a/controller/api/proxy/profile_watcher_test.go b/controller/api/proxy/profile_watcher_test.go index 6699f1750..1b43c60d9 100644 --- a/controller/api/proxy/profile_watcher_test.go +++ b/controller/api/proxy/profile_watcher_test.go @@ -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{ diff --git a/controller/gen/apis/serviceprofile/v1alpha1/types.go b/controller/gen/apis/serviceprofile/v1alpha1/types.go index f53fc4e82..e6681b3f8 100644 --- a/controller/gen/apis/serviceprofile/v1alpha1/types.go +++ b/controller/gen/apis/serviceprofile/v1alpha1/types.go @@ -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 { diff --git a/pkg/profiles/template.go b/pkg/profiles/template.go index e217c3190..bb9c2cd9c 100644 --- a/pkg/profiles/template.go +++ b/pkg/profiles/template.go @@ -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 `