Skip to content

Commit

Permalink
[release-1.10] sync with upstream (#488)
Browse files Browse the repository at this point in the history
* Min TLS for tag to digest defaults to 1.2 again and is configurable (knative#13963)

quay.io only supports 1.2

Co-authored-by: dprotaso <dprotaso@gmail.com>

* drop safe to evict annotations (knative#14051)

this prevents nodes from draining

Co-authored-by: dprotaso <dprotaso@gmail.com>

* [release-1.10] RandomChoice 2 policy wasn't random when the number of targets is 2 (with equal weight) (knative#14052)

* RandomChoice 2 policy wasn't random when the number of targets is 2

* fix linting

---------

Co-authored-by: dprotaso <dprotaso@gmail.com>

* [release-1.10] fix securityContext for Knative Service Pod (user-container and queue-proxy) (knative#14377)

* add seccompProfile to queue container security context

* run as non root by default

* update tests to expect new default run as nonroot

* fix perms

---------

Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Co-authored-by: Dave Protasowski <dprotaso@gmail.com>

* Leave a comment which will trigger a new dot release (knative#14501)

* [release-1.10] bump x/net to v0.17 (knative#14517)

* [release-1.10] bump x/net to v0.17

* Re-generate test/config/tls/cert-secret.yaml (knative#14324)

* Run hack/upgrade

* Bound buffer for reading stats (knative#14541)

Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com>

---------

Co-authored-by: Knative Prow Robot <knative-prow-robot@google.com>
Co-authored-by: dprotaso <dprotaso@gmail.com>
Co-authored-by: Clay Kauzlaric <ckauzlaric@vmware.com>
Co-authored-by: Kenjiro Nakayama <nakayamakenjiro@gmail.com>
Co-authored-by: Evan Anderson <evan.k.anderson@gmail.com>
  • Loading branch information
6 people authored Oct 20, 2023
1 parent 4c2c450 commit f0f4127
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/autoscaler/metrics/http_scrape_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ func statFromProto(body io.Reader) (Stat, error) {
b := pool.Get().(*bytes.Buffer)
b.Reset()
defer pool.Put(b)
_, err := b.ReadFrom(body)
// 6 8-byte fields (+2 bytes marshalling), one hostname, 20 bytes extra space
r := io.LimitedReader{R: body, N: 6*10 + 256 + 20}
_, err := b.ReadFrom(&r)
if err != nil {
return emptyStat, fmt.Errorf("reading body failed: %w", err)
}
Expand Down
15 changes: 15 additions & 0 deletions pkg/autoscaler/metrics/http_scrape_client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@ func TestHTTPScrapeClientScrapeProtoErrorCases(t *testing.T) {
responseCode: http.StatusOK,
responseType: "text/html",
expectedErr: errUnsupportedMetricType.Error(),
}, {
name: "LongStat",
responseCode: http.StatusOK,
responseType: "application/protobuf",
stat: Stat{
// We don't expect PodName to be 600 characters long
PodName: strings.Repeat("a123456789", 60),
AverageConcurrentRequests: 1.1,
AverageProxiedConcurrentRequests: 1.1,
RequestCount: 33.2,
ProxiedRequestCount: 33.2,
ProcessUptime: 12345.678,
Timestamp: 1697431278,
},
expectedErr: "unmarshalling failed: unexpected EOF",
}}

for _, test := range testCases {
Expand Down

0 comments on commit f0f4127

Please sign in to comment.