rebase: update K8s packages to v0.32.1

Update K8s packages in go.mod to v0.32.1

Signed-off-by: Praveen M <m.praveen@ibm.com>
This commit is contained in:
Praveen M
2025-01-16 09:41:46 +05:30
committed by mergify[bot]
parent 5aef21ea4e
commit 7eb99fc6c9
2442 changed files with 273386 additions and 47788 deletions

View File

@ -18,6 +18,7 @@ package metrics
import (
"context"
"sync"
"time"
"github.com/blang/semver/v4"
@ -125,11 +126,6 @@ func NewTestableTimingHistogramVec(nowFunc func() time.Time, opts *TimingHistogr
opts.StabilityLevel.setDefaults()
fqName := BuildFQName(opts.Namespace, opts.Subsystem, opts.Name)
allowListLock.RLock()
if allowList, ok := labelValueAllowLists[fqName]; ok {
opts.LabelValueAllowLists = allowList
}
allowListLock.RUnlock()
v := &TimingHistogramVec{
TimingHistogramVec: noopTimingHistogramVec,
@ -175,6 +171,15 @@ func (v *TimingHistogramVec) WithLabelValuesChecked(lvs ...string) (GaugeMetric,
}
if v.LabelValueAllowLists != nil {
v.LabelValueAllowLists.ConstrainToAllowedList(v.originalLabels, lvs)
} else {
v.initializeLabelAllowListsOnce.Do(func() {
allowListLock.RLock()
if allowList, ok := labelValueAllowLists[v.FQName()]; ok {
v.LabelValueAllowLists = allowList
allowList.ConstrainToAllowedList(v.originalLabels, lvs)
}
allowListLock.RUnlock()
})
}
ops, err := v.TimingHistogramVec.GetMetricWithLabelValues(lvs...)
if err != nil {
@ -214,6 +219,15 @@ func (v *TimingHistogramVec) WithChecked(labels map[string]string) (GaugeMetric,
}
if v.LabelValueAllowLists != nil {
v.LabelValueAllowLists.ConstrainLabelMap(labels)
} else {
v.initializeLabelAllowListsOnce.Do(func() {
allowListLock.RLock()
if allowList, ok := labelValueAllowLists[v.FQName()]; ok {
v.LabelValueAllowLists = allowList
allowList.ConstrainLabelMap(labels)
}
allowListLock.RUnlock()
})
}
ops, err := v.TimingHistogramVec.GetMetricWith(labels)
return ops.(GaugeMetric), err
@ -254,6 +268,13 @@ func (v *TimingHistogramVec) Reset() {
v.TimingHistogramVec.Reset()
}
// ResetLabelAllowLists resets the label allow list for the TimingHistogramVec.
// NOTE: This should only be used in test.
func (v *TimingHistogramVec) ResetLabelAllowLists() {
v.initializeLabelAllowListsOnce = sync.Once{}
v.LabelValueAllowLists = nil
}
// WithContext returns wrapped TimingHistogramVec with context
func (v *TimingHistogramVec) InterfaceWithContext(ctx context.Context) GaugeVecMetric {
return &TimingHistogramVecWithContext{