From ef8684c11d2c09c2a4b33418fd7fde62c8d2875d Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 20 May 2021 13:01:12 +0300 Subject: [PATCH] s3-gw: drop build time setting It's not properly set anyway and it's a bad practice for build reproducibility. Signed-off-by: Roman Khimov --- api/metrics/collector.go | 4 +--- cmd/s3-gw/app-settings.go | 5 ++--- misc/build.go | 2 -- 3 files changed, 3 insertions(+), 8 deletions(-) diff --git a/api/metrics/collector.go b/api/metrics/collector.go index c6f89c326..c7a7d25ea 100644 --- a/api/metrics/collector.go +++ b/api/metrics/collector.go @@ -19,8 +19,6 @@ var ( []string{ // current version "version", - // build time of the current version - "build_time", }, ) @@ -62,7 +60,7 @@ func (s *stats) Describe(ch chan<- *prometheus.Desc) { func (s *stats) Collect(ch chan<- prometheus.Metric) { // Expose current version information - versionInfo.WithLabelValues(misc.Version, misc.Build).Set(1.0) + versionInfo.WithLabelValues(misc.Version).Set(1.0) // connect collectors collectHTTPMetrics(ch) diff --git a/cmd/s3-gw/app-settings.go b/cmd/s3-gw/app-settings.go index 87f9538f4..57f7a5de3 100644 --- a/cmd/s3-gw/app-settings.go +++ b/cmd/s3-gw/app-settings.go @@ -181,7 +181,6 @@ func newSettings() *viper.Viper { // set prefers: v.Set(cfgApplicationName, misc.ApplicationName) v.Set(cfgApplicationVersion, misc.Version) - v.Set(cfgApplicationBuildTime, misc.Build) // set defaults: @@ -229,7 +228,7 @@ func newSettings() *viper.Viper { switch { case help != nil && *help: - fmt.Printf("NeoFS S3 Gateway %s (%s)\n", misc.Version, misc.Build) + fmt.Printf("NeoFS S3 Gateway %s\n", misc.Version) flags.PrintDefaults() fmt.Println() @@ -256,7 +255,7 @@ func newSettings() *viper.Viper { os.Exit(0) case version != nil && *version: - fmt.Printf("NeoFS S3 Gateway %s (%s)\n", misc.Version, misc.Build) + fmt.Printf("NeoFS S3 Gateway %s\n", misc.Version) os.Exit(0) case ttl != nil && ttl.Minutes() < minimumTTLInMinutes: fmt.Printf("connection ttl should not be less than %s", defaultTTL) diff --git a/misc/build.go b/misc/build.go index a66717c88..867aff9f1 100644 --- a/misc/build.go +++ b/misc/build.go @@ -9,8 +9,6 @@ const ( ) var ( - // Build holds build timestamp. - Build = "now" // Version contains application version. Version = "dev" )