Skip to content

Commit

Permalink
Merge branch 'master' into fix5165
Browse files Browse the repository at this point in the history
  • Loading branch information
lahabana authored Oct 19, 2022
2 parents ccb8861 + 9d2034d commit 1124e6f
Show file tree
Hide file tree
Showing 19 changed files with 930 additions and 251 deletions.
1 change: 1 addition & 0 deletions app/kuma-dp/pkg/dataplane/metrics/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ func RemoveQueryParameters(_ url.Values) string {

func AddPrometheusFormat(queryParameters url.Values) string {
queryParameters.Add("format", "prometheus")
queryParameters.Add("text_readouts", "")
return queryParameters.Encode()
}

Expand Down
4 changes: 2 additions & 2 deletions app/kuma-dp/pkg/dataplane/metrics/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ var _ = Describe("Rewriting the metrics URL", func() {
address: "1.2.3.4",
input: "http://foo/bar",
adminPort: 99,
expected: "http://1.2.3.4:99/stats?format=prometheus",
expected: "http://1.2.3.4:99/stats?format=prometheus&text_readouts=",
queryModifier: AddPrometheusFormat,
}),
Entry("preserve query parameters", testCase{
address: "1.2.3.4",
input: "http://foo/bar?one=two&three=four&filter=test_.*&usedonly",
adminPort: 80,
expected: "http://1.2.3.4:80/stats?filter=test_.%2A&format=prometheus&one=two&three=four&usedonly=",
expected: "http://1.2.3.4:80/stats?filter=test_.%2A&format=prometheus&one=two&text_readouts=&three=four&usedonly=",
queryModifier: AddPrometheusFormat,
}),
Entry("remove query parameters", testCase{
Expand Down
2 changes: 1 addition & 1 deletion app/kumactl/cmd/apply/apply_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -508,7 +508,7 @@ spec:
default:
action: foo
`,
err: `YAML contains invalid resource: from.0.default.action: from.0.default.action must be one of the following: "ALLOW", "DENY", "ALLOW_WITH_SHADOW_DENY", "DENY_WITH_SHADOW_ALLOW"`,
err: `YAML contains invalid resource: spec: from[0].default.action in body should be one of [ALLOW DENY ALLOW_WITH_SHADOW_DENY DENY_WITH_SHADOW_ALLOW]`,
}),
)
})
Loading

0 comments on commit 1124e6f

Please sign in to comment.