Skip to content

Commit

Permalink
clean broken --version flag
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorand committed Jan 23, 2023
1 parent 689a1f5 commit ca7bc25
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 9 deletions.
7 changes: 0 additions & 7 deletions internal/wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,11 @@ package internal
import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
"time"

"github.com/fsnotify/fsnotify"
"github.com/prometheus/common/version"
"github.com/spf13/viper"
"gopkg.in/yaml.v3"
"k8s.io/klog/v2"
Expand All @@ -36,11 +34,6 @@ import (

// RunKubeStateMetricsWrapper is a wrapper around KSM, delegated to the root command.
func RunKubeStateMetricsWrapper(opts *options.Options) {
if opts.Version {
fmt.Printf("%s\n", version.Print("kube-state-metrics"))
klog.FlushAndExit(klog.ExitFlushTimeout, 0)
}

KSMRunOrDie := func(ctx context.Context) {
if err := app.RunKubeStateMetricsWrapper(ctx, opts); err != nil {
klog.ErrorS(err, "Failed to run kube-state-metrics")
Expand Down
2 changes: 0 additions & 2 deletions pkg/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ type Options struct {
TelemetryPort int `yaml:"telemetry_port"`
TotalShards int `yaml:"total_shards"`
UseAPIServerCache bool `yaml:"use_api_server_cache"`
Version bool `yaml:"version"`

Config string

Expand Down Expand Up @@ -123,7 +122,6 @@ func (o *Options) AddFlags(cmd *cobra.Command) {
o.cmd.Flags().BoolVar(&o.EnableGZIPEncoding, "enable-gzip-encoding", false, "Gzip responses when requested by clients via 'Accept-Encoding: gzip' header.")
o.cmd.Flags().BoolVarP(&o.Help, "help", "h", false, "Print Help text")
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.")
o.cmd.Flags().BoolVarP(&o.Version, "version", "", false, "kube-state-metrics build version information")
o.cmd.Flags().Int32Var(&o.Shard, "shard", int32(0), "The instances shard nominal (zero indexed) within the total number of shards. (default 0)")
o.cmd.Flags().IntVar(&o.Port, "port", 8080, `Port to expose metrics on.`)
o.cmd.Flags().IntVar(&o.TelemetryPort, "telemetry-port", 8081, `Port to expose kube-state-metrics self metrics on.`)
Expand Down

0 comments on commit ca7bc25

Please sign in to comment.