Bump sigs.k8s.io/controller-runtime to v0.14.4 (#5507)
* Bump sigs.k8s.io/controller-runtime to v0.14.4 * Update gofmt
This commit is contained in:
10
vendor/k8s.io/component-base/featuregate/feature_gate.go
generated
vendored
10
vendor/k8s.io/component-base/featuregate/feature_gate.go
generated
vendored
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
package featuregate
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"sort"
|
||||
"strconv"
|
||||
@@ -27,6 +28,7 @@ import (
|
||||
"github.com/spf13/pflag"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/naming"
|
||||
featuremetrics "k8s.io/component-base/metrics/prometheus/feature"
|
||||
"k8s.io/klog/v2"
|
||||
)
|
||||
|
||||
@@ -111,6 +113,8 @@ type MutableFeatureGate interface {
|
||||
Add(features map[Feature]FeatureSpec) error
|
||||
// GetAll returns a copy of the map of known feature names to feature specs.
|
||||
GetAll() map[Feature]FeatureSpec
|
||||
// AddMetrics adds feature enablement metrics
|
||||
AddMetrics()
|
||||
}
|
||||
|
||||
// featureGate implements FeatureGate as well as pflag.Value for flag parsing.
|
||||
@@ -329,6 +333,12 @@ func (f *featureGate) AddFlag(fs *pflag.FlagSet) {
|
||||
"Options are:\n"+strings.Join(known, "\n"))
|
||||
}
|
||||
|
||||
func (f *featureGate) AddMetrics() {
|
||||
for feature, featureSpec := range f.GetAll() {
|
||||
featuremetrics.RecordFeatureInfo(context.Background(), string(feature), string(featureSpec.PreRelease), f.Enabled(feature))
|
||||
}
|
||||
}
|
||||
|
||||
// KnownFeatures returns a slice of strings describing the FeatureGate's known features.
|
||||
// Deprecated and GA features are hidden from the list.
|
||||
func (f *featureGate) KnownFeatures() []string {
|
||||
|
||||
Reference in New Issue
Block a user