Compare commits

...

3 Commits

Author SHA1 Message Date
Benjamin Pinchon 2a2b75447e
Merge 5d60407b7b into 534f4a9fb1 2025-10-02 08:42:22 +08:00
yangw 534f4a9fb1
fix: timeN function return final closure not be called (#21615)
VulnCheck / Analysis (push) Has been cancelled Details
2025-09-30 23:06:01 -07:00
Benjamin Pinchon 5d60407b7b feat(helm): support minAvailable in podDisruptionBudget
Signed-off-by: Benjamin Pinchon <dev@mdfr.me>
2025-09-26 11:08:50 +02:00
3 changed files with 15 additions and 11 deletions

View File

@ -106,16 +106,14 @@ func (p *scannerMetrics) log(s scannerMetric, paths ...string) func(custom map[s
// time n scanner actions.
// Use for s < scannerMetricLastRealtime
func (p *scannerMetrics) timeN(s scannerMetric) func(n int) func() {
func (p *scannerMetrics) timeN(s scannerMetric) func(n int) {
startTime := time.Now()
return func(n int) func() {
return func() {
duration := time.Since(startTime)
return func(n int) {
duration := time.Since(startTime)
atomic.AddUint64(&p.operations[s], uint64(n))
if s < scannerMetricLastRealtime {
p.latency[s].add(duration)
}
atomic.AddUint64(&p.operations[s], uint64(n))
if s < scannerMetricLastRealtime {
p.latency[s].add(duration)
}
}
}

View File

@ -6,11 +6,16 @@ apiVersion: policy/v1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: minio
name: {{ template "minio.fullname" . }}
labels:
app: {{ template "minio.name" . }}
spec:
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- with .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ . }}
{{- end }}
{{- with .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ . }}
{{- end }}
selector:
matchLabels:
app: {{ template "minio.name" . }}

View File

@ -585,7 +585,8 @@ networkPolicy:
##
podDisruptionBudget:
enabled: false
maxUnavailable: 1
maxUnavailable: ~
minAvailable: ~
## Specify the service account to use for the MinIO pods. If 'create' is set to 'false'
## and 'name' is left unspecified, the account 'default' will be used.