Skip to content

Commit ca7bc25

Browse files
committed
clean broken --version flag
1 parent 689a1f5 commit ca7bc25

File tree

2 files changed

+0
-9
lines changed

2 files changed

+0
-9
lines changed

internal/wrapper.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,11 @@ package internal
1919
import (
2020
"context"
2121
"errors"
22-
"fmt"
2322
"os"
2423
"path/filepath"
2524
"time"
2625

2726
"github.com/fsnotify/fsnotify"
28-
"github.com/prometheus/common/version"
2927
"github.com/spf13/viper"
3028
"gopkg.in/yaml.v3"
3129
"k8s.io/klog/v2"
@@ -36,11 +34,6 @@ import (
3634

3735
// RunKubeStateMetricsWrapper is a wrapper around KSM, delegated to the root command.
3836
func RunKubeStateMetricsWrapper(opts *options.Options) {
39-
if opts.Version {
40-
fmt.Printf("%s\n", version.Print("kube-state-metrics"))
41-
klog.FlushAndExit(klog.ExitFlushTimeout, 0)
42-
}
43-
4437
KSMRunOrDie := func(ctx context.Context) {
4538
if err := app.RunKubeStateMetricsWrapper(ctx, opts); err != nil {
4639
klog.ErrorS(err, "Failed to run kube-state-metrics")

pkg/options/options.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ type Options struct {
5555
TelemetryPort int `yaml:"telemetry_port"`
5656
TotalShards int `yaml:"total_shards"`
5757
UseAPIServerCache bool `yaml:"use_api_server_cache"`
58-
Version bool `yaml:"version"`
5958

6059
Config string
6160

@@ -123,7 +122,6 @@ func (o *Options) AddFlags(cmd *cobra.Command) {
123122
o.cmd.Flags().BoolVar(&o.EnableGZIPEncoding, "enable-gzip-encoding", false, "Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.")
124123
o.cmd.Flags().BoolVarP(&o.Help, "help", "h", false, "Print Help text")
125124
o.cmd.Flags().BoolVarP(&o.UseAPIServerCache, "use-apiserver-cache", "", false, "Sets resourceVersion=0 for ListWatch requests, using cached resources from the apiserver instead of an etcd quorum read.")
126-
o.cmd.Flags().BoolVarP(&o.Version, "version", "", false, "kube-state-metrics build version information")
127125
o.cmd.Flags().Int32Var(&o.Shard, "shard", int32(0), "The instances shard nominal (zero indexed) within the total number of shards. (default 0)")
128126
o.cmd.Flags().IntVar(&o.Port, "port", 8080, `Port to expose metrics on.`)
129127
o.cmd.Flags().IntVar(&o.TelemetryPort, "telemetry-port", 8081, `Port to expose kube-state-metrics self metrics on.`)

0 commit comments

Comments
 (0)