mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
add disclaimer to CLI help text
Change-Id: I32e52e97ec6bc7514a0030c8d83ad74bc346f7d5
This commit is contained in:
parent
0e32c43e07
commit
51be88a845
@ -61,17 +61,18 @@ func (o *Options) AddFlags(fs *pflag.FlagSet) {
|
||||
"disabled-metrics",
|
||||
o.DisabledMetrics,
|
||||
"This flag provides an escape hatch for misbehaving metrics. "+
|
||||
"You must provide the fully qualified metric name in order to disable it.")
|
||||
"You must provide the fully qualified metric name in order to disable it. "+
|
||||
"Disclaimer: disabling metrics is higher in precedence than showing hidden metrics.")
|
||||
}
|
||||
|
||||
// Apply applies parameters into global configuration of metrics.
|
||||
func (o *Options) Apply() {
|
||||
if o != nil && len(o.ShowHiddenMetricsForVersion) > 0 {
|
||||
SetShowHidden()
|
||||
// set disabled metrics
|
||||
for _, metricName := range o.DisabledMetrics {
|
||||
SetDisabledMetric(metricName)
|
||||
}
|
||||
}
|
||||
// set disabled metrics
|
||||
for _, metricName := range o.DisabledMetrics {
|
||||
SetDisabledMetric(metricName)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -517,7 +517,9 @@ func TestRegistryReset(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDisabledMetrics(t *testing.T) {
|
||||
SetDisabledMetric("should_be_disabled")
|
||||
o := NewOptions()
|
||||
o.DisabledMetrics = []string{"should_be_disabled"}
|
||||
o.Apply()
|
||||
currentVersion := apimachineryversion.Info{
|
||||
Major: "1",
|
||||
Minor: "17",
|
||||
|
Loading…
Reference in New Issue
Block a user