From ffa4c7bf0e6b315e4b64b45dd9816b8af7841f8e Mon Sep 17 00:00:00 2001 From: "Mikulas (Mike) Dite" Date: Wed, 3 Mar 2021 10:46:37 +0000 Subject: [PATCH] fix labels-metric-allow-list documentation The parser defined in types.go does not expect quotes https://github.com/kubernetes/kube-state-metrics/blob/master/pkg/options/types.go#L136-L140 https://github.com/kubernetes/kube-state-metrics/blob/master/pkg/options/types_test.go#L168 --- docs/cli-arguments.md | 2 +- pkg/options/options.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cli-arguments.md b/docs/cli-arguments.md index 1dc8b825fc..0ab2cfc338 100644 --- a/docs/cli-arguments.md +++ b/docs/cli-arguments.md @@ -32,7 +32,7 @@ Usage of ./kube-state-metrics: -h, --help Print Help text --host string Host to expose metrics on. (default "0.0.0.0") --kubeconfig string Absolute path to the kubeconfig file - --labels-metric-allow-list string Allows to pass a list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=["k8s-label-1","k8s-label-n",...],pods=["app"],...)' + --labels-metric-allow-list string Allows to pass a list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)' --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) --log_dir string If non-empty, write log files in this directory --log_file string If non-empty, use this log file diff --git a/pkg/options/options.go b/pkg/options/options.go index 95cd3474a8..d6340b37f9 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -97,7 +97,7 @@ func (o *Options) AddFlags() { o.flags.StringVar(&o.Namespace, "pod-namespace", "", "Name of the namespace of the pod specified by --pod. "+autoshardingNotice) o.flags.BoolVarP(&o.Version, "version", "", false, "kube-state-metrics build version information") o.flags.BoolVar(&o.EnableGZIPEncoding, "enable-gzip-encoding", false, "Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.") - o.flags.Var(&o.LabelsAllowList, "labels-metric-allow-list", "Allows to pass a list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=[\"k8s-label-1\",\"k8s-label-n\",...],pods=[\"app\"],...)'") + o.flags.Var(&o.LabelsAllowList, "labels-metric-allow-list", "Allows to pass a list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)'") } // Parse parses the flag definitions from the argument list.