Change ENV prefix

TODO should be replaced with S3_GW before release

Signed-off-by: Evgeniy Kulikov <kim@nspcc.ru>
remotes/KirillovDenis/bugfix/681-fix_acl_parsing
Evgeniy Kulikov 2020-12-01 10:02:26 +03:00
parent 5752f2f89f
commit f5fb850c3f
4 changed files with 21 additions and 15 deletions

View File

@ -20,7 +20,12 @@ RUN set -x \
&& export GOGC=off \
&& export CGO_ENABLED=0 \
&& [ -d "./vendor" ] || go mod vendor \
&& go build -v -mod=vendor -trimpath -gcflags "all=-N -l" -ldflags "${LDFLAGS}" -o /go/bin/neofs-s3 ./cmd/gate \
&& go build \
-v \
-mod=vendor \
-trimpath \
-ldflags "${LDFLAGS} -X main.Build=$(date -u +%s%N) -X main.Prefix=S3_GW" \
-o /go/bin/neofs-s3 ./cmd/gate \
&& upx -3 /go/bin/neofs-s3
# Executable image

View File

@ -40,6 +40,7 @@ const ( // settings
cfgLoggerLevel = "logger.level"
cfgLoggerFormat = "logger.format"
cfgLoggerTraceLevel = "logger.trace_level"
cfgLoggerNoCaller = "logger.no_caller"
cfgLoggerNoDisclaimer = "logger.no_disclaimer"
cfgLoggerSamplingInitial = "logger.sampling.initial"
cfgLoggerSamplingThereafter = "logger.sampling.thereafter"
@ -171,6 +172,7 @@ func newSettings() *viper.Viper {
v.SetDefault(cfgLoggerLevel, "debug")
v.SetDefault(cfgLoggerFormat, "console")
v.SetDefault(cfgLoggerTraceLevel, "panic")
v.SetDefault(cfgLoggerNoCaller, false)
v.SetDefault(cfgLoggerNoDisclaimer, true)
v.SetDefault(cfgLoggerSamplingInitial, 1000)
v.SetDefault(cfgLoggerSamplingThereafter, 1000)

View File

@ -9,23 +9,23 @@ import (
func newLogger(v *viper.Viper) *zap.Logger {
options := []logger.Option{
logger.WithLevel(v.GetString("logger.level")),
logger.WithTraceLevel(v.GetString("logger.trace_level")),
logger.WithLevel(v.GetString(cfgLoggerLevel)),
logger.WithTraceLevel(v.GetString(cfgLoggerTraceLevel)),
logger.WithFormat(v.GetString("logger.format")),
logger.WithFormat(v.GetString(cfgLoggerFormat)),
logger.WithSamplingInitial(v.GetInt("logger.sampling.initial")),
logger.WithSamplingThereafter(v.GetInt("logger.sampling.thereafter")),
logger.WithSamplingInitial(v.GetInt(cfgLoggerSamplingInitial)),
logger.WithSamplingThereafter(v.GetInt(cfgLoggerSamplingThereafter)),
logger.WithAppName(v.GetString("app_name")),
logger.WithAppVersion(v.GetString("app_version")),
logger.WithAppName(v.GetString(cfgApplicationName)),
logger.WithAppVersion(v.GetString(cfgApplicationVersion)),
}
if v.GetBool("logger.no_caller") {
if v.GetBool(cfgLoggerNoCaller) {
options = append(options, logger.WithoutCaller())
}
if v.GetBool("logger.no_disclaimer") {
if v.GetBool(cfgLoggerNoDisclaimer) {
options = append(options, logger.WithoutDisclaimer())
}

View File

@ -1,12 +1,11 @@
package misc
const (
Prefix = "S3"
ApplicationName = "neofs-s3-gate"
)
const ApplicationName = "neofs-s3-gate"
var (
// TODO should be replaced with S3_GW before release
Prefix = "S3"
Build = "now"
Version = "dev"
)