diff --git a/docs/cli-arguments.md b/docs/cli-arguments.md index 67190c66b5..0b812011b7 100644 --- a/docs/cli-arguments.md +++ b/docs/cli-arguments.md @@ -75,7 +75,6 @@ Flags: --total-shards int The total number of shards. Sharding is disabled when total shards is set to 1. (default 1) --use-apiserver-cache Sets resourceVersion=0 for ListWatch requests, using cached resources from the apiserver instead of an etcd quorum read. -v, --v Level number for the log level verbosity - --version kube-state-metrics build version information --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging Use "kube-state-metrics [command] --help" for more information about a command. diff --git a/pkg/options/options.go b/pkg/options/options.go index bb26ef21ff..0f55785e96 100644 --- a/pkg/options/options.go +++ b/pkg/options/options.go @@ -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 @@ -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.`) diff --git a/pkg/version/version.go b/pkg/version/version.go deleted file mode 100644 index b6c42b07c3..0000000000 --- a/pkg/version/version.go +++ /dev/null @@ -1,64 +0,0 @@ -/* -Copyright 2017 The Kubernetes Authors. -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package version - -import ( - "fmt" - "os" - "path/filepath" - "runtime" -) - -var ( - // Release returns the release version - Release = "UNKNOWN" - // Commit returns the short sha from git - Commit = "UNKNOWN" - // BuildDate is the build date - BuildDate = "" -) - -// Version is the current version of kube-state-metrics. -// Update this whenever making a new release. -// The version is of the format Major.Minor.Patch -// -// Increment major number for new feature additions and behavioral changes. -// Increment minor number for bug fixes and performance enhancements. -// Increment patch number for critical fixes to existing releases. -type Version struct { - GitCommit string - BuildDate string - Release string - GoVersion string - Compiler string - Platform string -} - -func (v Version) String() string { - return fmt.Sprintf("%s/%s (%s/%s) kube-state-metrics/%s", - filepath.Base(os.Args[0]), v.Release, - runtime.GOOS, runtime.GOARCH, v.GitCommit) -} - -// GetVersion returns the kube-state-metrics version. -func GetVersion() Version { - return Version{ - GitCommit: Commit, - BuildDate: BuildDate, - Release: Release, - GoVersion: runtime.Version(), - Compiler: runtime.Compiler, - Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), - } -}