mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-13 18:43:34 +00:00
Changes to accommodate client-go changes and kube vendor update
to v1.18.0 Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
committed by
mergify[bot]
parent
4c96ad3c85
commit
34fc1d847e
13
vendor/k8s.io/component-base/metrics/metric.go
generated
vendored
13
vendor/k8s.io/component-base/metrics/metric.go
generated
vendored
@ -63,6 +63,7 @@ implements kubeCollector to get deferred registration behavior. You must call la
|
||||
with the kubeCollector itself as an argument.
|
||||
*/
|
||||
type lazyMetric struct {
|
||||
fqName string
|
||||
isDeprecated bool
|
||||
isHidden bool
|
||||
isCreated bool
|
||||
@ -81,7 +82,8 @@ func (r *lazyMetric) IsCreated() bool {
|
||||
// lazyInit provides the lazyMetric with a reference to the kubeCollector it is supposed
|
||||
// to allow lazy initialization for. It should be invoked in the factory function which creates new
|
||||
// kubeCollector type objects.
|
||||
func (r *lazyMetric) lazyInit(self kubeCollector) {
|
||||
func (r *lazyMetric) lazyInit(self kubeCollector, fqName string) {
|
||||
r.fqName = fqName
|
||||
r.self = self
|
||||
}
|
||||
|
||||
@ -98,7 +100,7 @@ func (r *lazyMetric) determineDeprecationStatus(version semver.Version) {
|
||||
r.isDeprecated = true
|
||||
}
|
||||
if ShouldShowHidden() {
|
||||
klog.Warningf("Hidden metrics have been manually overridden, showing this very deprecated metric.")
|
||||
klog.Warningf("Hidden metrics (%s) have been manually overridden, showing this very deprecated metric.", r.fqName)
|
||||
return
|
||||
}
|
||||
if shouldHide(&version, selfVersion) {
|
||||
@ -156,6 +158,11 @@ func (r *lazyMetric) ClearState() {
|
||||
r.createOnce = *(new(sync.Once))
|
||||
}
|
||||
|
||||
// FQName returns the fully-qualified metric name of the collector.
|
||||
func (r *lazyMetric) FQName() string {
|
||||
return r.fqName
|
||||
}
|
||||
|
||||
/*
|
||||
This code is directly lifted from the prometheus codebase. It's a convenience struct which
|
||||
allows you satisfy the Collector interface automatically if you already satisfy the Metric interface.
|
||||
@ -181,6 +188,8 @@ func (c *selfCollector) Collect(ch chan<- prometheus.Metric) {
|
||||
// no-op vecs for convenience
|
||||
var noopCounterVec = &prometheus.CounterVec{}
|
||||
var noopHistogramVec = &prometheus.HistogramVec{}
|
||||
|
||||
// lint:ignore U1000 Keep it for future use
|
||||
var noopSummaryVec = &prometheus.SummaryVec{}
|
||||
var noopGaugeVec = &prometheus.GaugeVec{}
|
||||
var noopObserverVec = &noopObserverVector{}
|
||||
|
Reference in New Issue
Block a user