Skip to content

Commit

Permalink
Add double quotes
Browse files Browse the repository at this point in the history
Signed-off-by: Mustafa Abdelrahman <[email protected]>
  • Loading branch information
MustafaSaber committed Aug 8, 2023
1 parent 919cf5f commit 5b5cf9c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions cmd/webhook/admission/admission_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,22 +168,22 @@ func TestIngressAdmitter(t *testing.T) {
{
name: "invalid eskip filters",
inputFile: "invalid-filters.json",
message: "Ingress validation failed: parsing zalando.org/skipper-filter annotation failed: parse failed after token this, last route id: , position 9: syntax error",
message: `Ingress validation failed: parsing \"zalando.org/skipper-filter\" annotation failed: parse failed after token this, last route id: , position 9: syntax error`,
},
{
name: "invalid eskip predicates",
inputFile: "invalid-predicates.json",
message: "Ingress validation failed: parsing zalando.org/skipper-predicate annotation failed: parse failed after token ), last route id: , position 15: syntax error",
message: `Ingress validation failed: parsing \"zalando.org/skipper-predicate\" annotation failed: parse failed after token ), last route id: , position 15: syntax error`,
},
{
name: "invalid eskip routes",
inputFile: "invalid-routes.json",
message: "Ingress validation failed: parsing zalando.org/skipper-routes annotation failed: invalid predicate count arg",
message: `Ingress validation failed: parsing \"zalando.org/skipper-routes\" annotation failed: invalid predicate count arg`,
},
{
name: "invalid eskip filters and predicates",
inputFile: "invalid-filters-and-predicates.json",
message: "Ingress validation failed: parsing zalando.org/skipper-filter annotation failed: parse failed after token this, last route id: , position 9: syntax error\\nparsing zalando.org/skipper-predicate annotation failed: parse failed after token ), last route id: , position 15: syntax error",
message: `Ingress validation failed: parsing \"zalando.org/skipper-filter\" annotation failed: parse failed after token this, last route id: , position 9: syntax error\nparsing \"zalando.org/skipper-predicate\" annotation failed: parse failed after token ), last route id: , position 15: syntax error`,
},
} {
t.Run(tc.name, func(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions dataclients/kubernetes/definitions/ingressvalidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (IngressV1Validator) validateFilterAnnotation(annotations map[string]string
if filters, ok := annotations[skipperfilterAnnotationKey]; ok {
_, err := eskip.ParseFilters(filters)
if err != nil {
err = fmt.Errorf("parsing %s annotation failed: %w", skipperfilterAnnotationKey, err)
err = fmt.Errorf("parsing \"%s\" annotation failed: %w", skipperfilterAnnotationKey, err)
}
return err
}
Expand All @@ -58,7 +58,7 @@ func (IngressV1Validator) validatePredicateAnnotation(annotations map[string]str
if predicates, ok := annotations[skipperpredicateAnnotationKey]; ok {
_, err := eskip.ParsePredicates(predicates)
if err != nil {
err = fmt.Errorf("parsing %s annotation failed: %w", skipperpredicateAnnotationKey, err)
err = fmt.Errorf("parsing \"%s\" annotation failed: %w", skipperpredicateAnnotationKey, err)
}
return err
}
Expand All @@ -69,7 +69,7 @@ func (IngressV1Validator) validateRoutesAnnotation(annotations map[string]string
if routes, ok := annotations[skipperRoutesAnnotationKey]; ok {
_, err := eskip.Parse(routes)
if err != nil {
err = fmt.Errorf("parsing %s annotation failed: %w", skipperRoutesAnnotationKey, err)
err = fmt.Errorf("parsing \"%s\" annotation failed: %w", skipperRoutesAnnotationKey, err)
}
return err
}
Expand Down

0 comments on commit 5b5cf9c

Please sign in to comment.