From d0030ab5559aff031cef89c7caf1502c9a8d6e99 Mon Sep 17 00:00:00 2001 From: Willy Kloucek Date: Thu, 16 Dec 2021 18:53:06 +0100 Subject: [PATCH] switch ocs to struct tag based env config --- accounts/pkg/command/root.go | 2 +- accounts/pkg/command/server.go | 17 +-- accounts/pkg/logging/logging.go | 17 +++ .../pkg/proto/v0/accounts.pb.micro_test.go | 5 +- glauth/pkg/config/config.go | 1 - graph-explorer/pkg/config/config.go | 1 - graph/pkg/config/config.go | 1 - idp/pkg/config/config.go | 1 - ocs/pkg/command/root.go | 39 +++--- ocs/pkg/command/server.go | 7 +- ocs/pkg/config/config.go | 53 ++++---- ocs/pkg/config/mappings.go | 119 ------------------ ocs/pkg/logging/logging.go | 17 +++ ocs/pkg/server/http/svc_test.go | 10 +- settings/pkg/config/config.go | 1 - storage/pkg/config/config.go | 1 - store/pkg/config/config.go | 1 - web/pkg/config/config.go | 1 - 18 files changed, 101 insertions(+), 193 deletions(-) create mode 100644 accounts/pkg/logging/logging.go delete mode 100644 ocs/pkg/config/mappings.go create mode 100644 ocs/pkg/logging/logging.go diff --git a/accounts/pkg/command/root.go b/accounts/pkg/command/root.go index 6b646b4f24..502ddb74a8 100644 --- a/accounts/pkg/command/root.go +++ b/accounts/pkg/command/root.go @@ -82,7 +82,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error { } // merge environment variable config on top of the current config - if err := mergo.Merge(cfg, envCfg, mergo.WithOverride); err != nil { + if err := mergo.Merge(cfg, envCfg, mergo.WithOverride); err != nil && err.Error() != "none of the target fields were set from environment variables" { return err } diff --git a/accounts/pkg/command/server.go b/accounts/pkg/command/server.go index e28e8373c9..2f68df37c3 100644 --- a/accounts/pkg/command/server.go +++ b/accounts/pkg/command/server.go @@ -4,10 +4,9 @@ import ( "context" "strings" - "github.com/owncloud/ocis/ocis-pkg/log" - "github.com/oklog/run" "github.com/owncloud/ocis/accounts/pkg/config" + "github.com/owncloud/ocis/accounts/pkg/logging" "github.com/owncloud/ocis/accounts/pkg/metrics" "github.com/owncloud/ocis/accounts/pkg/server/grpc" "github.com/owncloud/ocis/accounts/pkg/server/http" @@ -16,18 +15,6 @@ import ( "github.com/urfave/cli/v2" ) -// TODO: don't redeclare from ocis-pkg/log/log.go -// LoggerFromConfig initializes a service-specific logger instance. -func LoggerFromConfig(name string, cfg config.Log) log.Logger { - return log.NewLogger( - log.Name(name), - log.Level(cfg.Level), - log.Pretty(cfg.Pretty), - log.Color(cfg.Color), - log.File(cfg.File), - ) -} - // Server is the entry point for the server command. func Server(cfg *config.Config) *cli.Command { return &cli.Command{ @@ -48,7 +35,7 @@ func Server(cfg *config.Config) *cli.Command { return nil }, Action: func(c *cli.Context) error { - logger := LoggerFromConfig("accounts", cfg.Log) + logger := logging.Configure(cfg.Service.Name, cfg.Log) err := tracing.Configure(cfg) if err != nil { return err diff --git a/accounts/pkg/logging/logging.go b/accounts/pkg/logging/logging.go new file mode 100644 index 0000000000..9b09b128ed --- /dev/null +++ b/accounts/pkg/logging/logging.go @@ -0,0 +1,17 @@ +package logging + +import ( + "github.com/owncloud/ocis/accounts/pkg/config" + "github.com/owncloud/ocis/ocis-pkg/log" +) + +// LoggerFromConfig initializes a service-specific logger instance. +func Configure(name string, cfg config.Log) log.Logger { + return log.NewLogger( + log.Name(name), + log.Level(cfg.Level), + log.Pretty(cfg.Pretty), + log.Color(cfg.Color), + log.File(cfg.File), + ) +} diff --git a/accounts/pkg/proto/v0/accounts.pb.micro_test.go b/accounts/pkg/proto/v0/accounts.pb.micro_test.go index 85bb16a5d3..d15b0ab2d2 100644 --- a/accounts/pkg/proto/v0/accounts.pb.micro_test.go +++ b/accounts/pkg/proto/v0/accounts.pb.micro_test.go @@ -12,11 +12,12 @@ import ( mgrpcc "github.com/asim/go-micro/plugins/client/grpc/v4" empty "github.com/golang/protobuf/ptypes/empty" - "github.com/owncloud/ocis/accounts/pkg/command" "github.com/owncloud/ocis/accounts/pkg/config" "github.com/owncloud/ocis/accounts/pkg/proto/v0" svc "github.com/owncloud/ocis/accounts/pkg/service/v0" + oclog "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/service/grpc" + "github.com/owncloud/ocis/ocis-pkg/shared" settings "github.com/owncloud/ocis/settings/pkg/proto/v0" "github.com/stretchr/testify/assert" "go-micro.dev/v4/client" @@ -85,7 +86,7 @@ func init() { var hdlr *svc.Service var err error - if hdlr, err = svc.New(svc.Logger(command.LoggerFromConfig("accounts", cfg.Log)), svc.Config(cfg), svc.RoleService(buildRoleServiceMock())); err != nil { + if hdlr, err = svc.New(svc.Logger(oclog.LoggerFromConfig("accounts", shared.Log(cfg.Log))), svc.Config(cfg), svc.RoleService(buildRoleServiceMock())); err != nil { log.Fatalf("Could not create new service") } diff --git a/glauth/pkg/config/config.go b/glauth/pkg/config/config.go index c3b55c7720..f5dd394011 100644 --- a/glauth/pkg/config/config.go +++ b/glauth/pkg/config/config.go @@ -64,7 +64,6 @@ type Backend struct { type Config struct { *shared.Commons - File string `ocisConfig:"file"` Log *shared.Log `ocisConfig:"log"` Debug Debug `ocisConfig:"debug"` Service Service `ocisConfig:"service"` diff --git a/graph-explorer/pkg/config/config.go b/graph-explorer/pkg/config/config.go index 1acf398e87..0fcacecf42 100644 --- a/graph-explorer/pkg/config/config.go +++ b/graph-explorer/pkg/config/config.go @@ -46,7 +46,6 @@ type GraphExplorer struct { // Config combines all available configuration parts. type Config struct { - File string `ocisConfig:"file"` Log shared.Log `ocisConfig:"log"` Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` diff --git a/graph/pkg/config/config.go b/graph/pkg/config/config.go index 1cba3b4a24..5a113d20d1 100644 --- a/graph/pkg/config/config.go +++ b/graph/pkg/config/config.go @@ -81,7 +81,6 @@ type Identity struct { type Config struct { *shared.Commons - File string `ocisConfig:"file"` Log *shared.Log `ocisConfig:"log"` Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` diff --git a/idp/pkg/config/config.go b/idp/pkg/config/config.go index 54f1ff1d9a..510f06e6bf 100644 --- a/idp/pkg/config/config.go +++ b/idp/pkg/config/config.go @@ -100,7 +100,6 @@ type Settings struct { type Config struct { *shared.Commons - File string `ocisConfig:"file"` Log *shared.Log `ocisConfig:"log"` Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` diff --git a/ocs/pkg/command/root.go b/ocs/pkg/command/root.go index 19c53801c6..a74c904a78 100644 --- a/ocs/pkg/command/root.go +++ b/ocs/pkg/command/root.go @@ -4,14 +4,14 @@ import ( "context" "os" - "github.com/owncloud/ocis/ocis-pkg/shared" - + "github.com/imdario/mergo" ociscfg "github.com/owncloud/ocis/ocis-pkg/config" "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/version" "github.com/owncloud/ocis/ocs/pkg/config" "github.com/thejerf/suture/v4" "github.com/urfave/cli/v2" + "github.com/wkloucek/envdecode" ) // Execute is the entry point for the ocis-ocs command. @@ -67,28 +67,35 @@ func NewLogger(cfg *config.Config) log.Logger { // ParseConfig loads idp configuration from known paths. func ParseConfig(c *cli.Context, cfg *config.Config) error { - conf, err := ociscfg.BindSourcesToStructs("ocs", cfg) + _, err := ociscfg.BindSourcesToStructs("ocs", cfg) if err != nil { return err } // provide with defaults for shared logging, since we need a valid destination address for BindEnv. - if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil { - cfg.Log = &shared.Log{ - Level: cfg.Commons.Log.Level, - Pretty: cfg.Commons.Log.Pretty, - Color: cfg.Commons.Log.Color, - File: cfg.Commons.Log.File, - } - } else if cfg.Log == nil && cfg.Commons == nil { - cfg.Log = &shared.Log{} - } + //if cfg.Log == nil && cfg.Commons != nil && cfg.Commons.Log != nil { + // cfg.Log = &shared.Log{ + // Level: cfg.Commons.Log.Level, + // Pretty: cfg.Commons.Log.Pretty, + // Color: cfg.Commons.Log.Color, + // File: cfg.Commons.Log.File, + // } + //} else if cfg.Log == nil && cfg.Commons == nil { + // cfg.Log = &shared.Log{} + //} // load all env variables relevant to the config in the current context. - conf.LoadOSEnv(config.GetEnv(cfg), false) + envCfg := config.Config{} + if err := envdecode.Decode(&envCfg); err != nil { + return err + } - bindings := config.StructMappings(cfg) - return ociscfg.BindEnv(conf, bindings) + // merge environment variable config on top of the current config + if err := mergo.Merge(cfg, envCfg, mergo.WithOverride); err != nil && err.Error() != "none of the target fields were set from environment variables" { + return err + } + + return nil } // SutureService allows for the ocs command to be embedded and supervised by a suture supervisor tree. diff --git a/ocs/pkg/command/server.go b/ocs/pkg/command/server.go index d72e96216f..406e0221cc 100644 --- a/ocs/pkg/command/server.go +++ b/ocs/pkg/command/server.go @@ -4,6 +4,7 @@ import ( "context" "strings" + "github.com/owncloud/ocis/ocs/pkg/logging" "github.com/owncloud/ocis/ocs/pkg/tracing" "github.com/oklog/run" @@ -31,9 +32,9 @@ func Server(cfg *config.Config) *cli.Command { return nil }, Action: func(c *cli.Context) error { - logger := NewLogger(cfg) - - if err := tracing.Configure(cfg); err != nil { + logger := logging.Configure(cfg.Service.Name, cfg.Log) + err := tracing.Configure(cfg) + if err != nil { return err } diff --git a/ocs/pkg/config/config.go b/ocs/pkg/config/config.go index 882c6364ee..6c25c30175 100644 --- a/ocs/pkg/config/config.go +++ b/ocs/pkg/config/config.go @@ -8,10 +8,10 @@ import ( // Debug defines the available debug configuration. type Debug struct { - Addr string `ocisConfig:"addr"` - Token string `ocisConfig:"token"` - Pprof bool `ocisConfig:"pprof"` - Zpages bool `ocisConfig:"zpages"` + Addr string `ocisConfig:"addr" env:"OCS_DEBUG_ADDR"` + Token string `ocisConfig:"token" env:"OCS_DEBUG_TOKEN"` + Pprof bool `ocisConfig:"pprof" env:"OCS_DEBUG_PPROF"` + Zpages bool `ocisConfig:"zpages" env:"OCS_DEBUG_ZPAGES"` } // CORS defines the available cors configuration. @@ -24,60 +24,67 @@ type CORS struct { // HTTP defines the available http configuration. type HTTP struct { - Addr string `ocisConfig:"addr"` - Root string `ocisConfig:"root"` - Namespace string `ocisConfig:"namespace"` - CORS CORS `ocisConfig:"cors"` + Addr string `ocisConfig:"addr" env:"OCS_HTTP_ADDR"` + Root string `ocisConfig:"root" env:"OCS_HTTP_ROOT"` + Namespace string + CORS CORS `ocisConfig:"cors"` } // Service defines the available service configuration. type Service struct { - Name string `ocisConfig:"name"` - Version string `ocisConfig:"version"` + Name string + Version string } // Tracing defines the available tracing configuration. type Tracing struct { - Enabled bool `ocisConfig:"enabled"` - Type string `ocisConfig:"type"` - Endpoint string `ocisConfig:"endpoint"` - Collector string `ocisConfig:"collector"` - Service string `ocisConfig:"service"` + Enabled bool `ocisConfig:"enabled" env:"OCIS_TRACING_ENABLED;OCS_TRACING_ENABLED"` + Type string `ocisConfig:"type" env:"OCIS_TRACING_TYPE;OCS_TRACING_TYPE"` + Endpoint string `ocisConfig:"endpoint" env:"OCIS_TRACING_ENDPOINT;OCS_TRACING_ENDPOINT"` + Collector string `ocisConfig:"collector" env:"OCIS_TRACING_COLLECTOR;OCS_TRACING_COLLECTOR"` + Service string `ocisConfig:"service" env:"OCS_TRACING_SERVICE"` +} + +// Log defines the available log configuration. +type Log struct { + Level string `mapstructure:"level" env:"OCIS_LOG_LEVEL;OCS_LOG_LEVEL"` + Pretty bool `mapstructure:"pretty" env:"OCIS_LOG_PRETTY;OCS_LOG_PRETTY"` + Color bool `mapstructure:"color" env:"OCIS_LOG_COLOR;OCS_LOG_COLOR"` + File string `mapstructure:"file" env:"OCIS_LOG_FILE;OCS_LOG_FILE"` } // Reva defines all available REVA configuration. type Reva struct { - Address string `ocisConfig:"address"` + Address string `ocisConfig:"address" env:"REVA_GATEWAY"` } // TokenManager is the config for using the reva token manager type TokenManager struct { - JWTSecret string `ocisConfig:"jwt_secret"` + JWTSecret string `ocisConfig:"jwt_secret" env:"OCIS_JWT_SECRET;OCS_JWT_SECRET"` } // IdentityManagement keeps track of the OIDC address. This is because Reva requisite of uniqueness for users // is based in the combination of IDP hostname + UserID. For more information see: // https://github.com/cs3org/reva/blob/4fd0229f13fae5bc9684556a82dbbd0eced65ef9/pkg/storage/utils/decomposedfs/node/node.go#L856-L865 type IdentityManagement struct { - Address string `ocisConfig:"address"` + Address string `ocisConfig:"address" env:"OCIS_URL;OCS_IDM_ADDRESS"` } // Config combines all available configuration parts. type Config struct { *shared.Commons - File string `ocisConfig:"file"` - Log *shared.Log `ocisConfig:"log"` + Log Log `ocisConfig:"log"` Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"` Tracing Tracing `ocisConfig:"tracing"` TokenManager TokenManager `ocisConfig:"token_manager"` Service Service `ocisConfig:"service"` - AccountBackend string `ocisConfig:"account_backend"` Reva Reva `ocisConfig:"reva"` - StorageUsersDriver string `ocisConfig:"storage_users_driver"` - MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key"` IdentityManagement IdentityManagement `ocisConfig:"identity_management"` + AccountBackend string `ocisConfig:"account_backend" env:"OCS_ACCOUNT_BACKEND_TYPE"` + StorageUsersDriver string `ocisConfig:"storage_users_driver" env:"STORAGE_USERS_DRIVER;OCS_STORAGE_USERS_DRIVER"` + MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;OCS_MACHINE_AUTH_API_KEY"` Context context.Context Supervised bool diff --git a/ocs/pkg/config/mappings.go b/ocs/pkg/config/mappings.go deleted file mode 100644 index b32177739c..0000000000 --- a/ocs/pkg/config/mappings.go +++ /dev/null @@ -1,119 +0,0 @@ -package config - -import "github.com/owncloud/ocis/ocis-pkg/shared" - -// GetEnv fetches a list of known env variables for this extension. It is to be used by gookit, as it provides a list -// with all the environment variables an extension supports. -func GetEnv(cfg *Config) []string { - var r = make([]string, len(structMappings(cfg))) - for i := range structMappings(cfg) { - r = append(r, structMappings(cfg)[i].EnvVars...) - } - - return r -} - -// StructMappings binds a set of environment variables to a destination on cfg. Iterating over this set and editing the -// Destination value of a binding will alter the original value, as it is a pointer to its memory address. This lets -// us propagate changes easier. -func StructMappings(cfg *Config) []shared.EnvBinding { - return structMappings(cfg) -} - -// structMappings binds a set of environment variables to a destination on cfg. -func structMappings(cfg *Config) []shared.EnvBinding { - return []shared.EnvBinding{ - { - EnvVars: []string{"OCIS_LOG_FILE", "OCS_LOG_FILE"}, - Destination: &cfg.Log.File, - }, - { - EnvVars: []string{"OCIS_LOG_LEVEL", "OCS_LOG_LEVEL"}, - Destination: &cfg.Log.Level, - }, - { - EnvVars: []string{"OCIS_LOG_PRETTY", "OCS_LOG_PRETTY"}, - Destination: &cfg.Log.Pretty, - }, - { - EnvVars: []string{"OCIS_LOG_COLOR", "OCS_LOG_COLOR"}, - Destination: &cfg.Log.Color, - }, - { - EnvVars: []string{"OCS_CONFIG_FILE"}, - Destination: &cfg.File, - }, - { - EnvVars: []string{"OCIS_TRACING_ENABLED", "OCS_TRACING_ENABLED"}, - Destination: &cfg.Tracing.Enabled, - }, - { - EnvVars: []string{"OCIS_TRACING_TYPE", "OCS_TRACING_TYPE"}, - Destination: &cfg.Tracing.Type, - }, - { - EnvVars: []string{"OCIS_TRACING_ENDPOINT", "OCS_TRACING_ENDPOINT"}, - Destination: &cfg.Tracing.Endpoint, - }, - { - EnvVars: []string{"OCIS_TRACING_COLLECTOR", "OCS_TRACING_COLLECTOR"}, - Destination: &cfg.Tracing.Collector, - }, - { - EnvVars: []string{"OCS_TRACING_SERVICE"}, - Destination: &cfg.Tracing.Service, - }, - { - EnvVars: []string{"OCS_DEBUG_ADDR"}, - Destination: &cfg.Debug.Addr, - }, - { - EnvVars: []string{"OCS_DEBUG_TOKEN"}, - Destination: &cfg.Debug.Token, - }, - { - EnvVars: []string{"OCS_DEBUG_PPROF"}, - Destination: &cfg.Debug.Pprof, - }, - { - EnvVars: []string{"OCS_DEBUG_ZPAGES"}, - Destination: &cfg.Debug.Zpages, - }, - { - EnvVars: []string{"OCS_HTTP_ADDR"}, - Destination: &cfg.HTTP.Addr, - }, - { - EnvVars: []string{"OCS_HTTP_NAMESPACE"}, - Destination: &cfg.HTTP.Namespace, - }, - { - EnvVars: []string{"OCS_HTTP_ROOT"}, - Destination: &cfg.HTTP.Root, - }, - { - EnvVars: []string{"OCIS_JWT_SECRET", "OCS_JWT_SECRET"}, - Destination: &cfg.TokenManager.JWTSecret, - }, - { - EnvVars: []string{"OCS_ACCOUNT_BACKEND_TYPE"}, - Destination: &cfg.AccountBackend, - }, - { - EnvVars: []string{"REVA_GATEWAY"}, - Destination: &cfg.Reva.Address, - }, - { - EnvVars: []string{"OCIS_MACHINE_AUTH_API_KEY", "OCS_MACHINE_AUTH_API_KEY"}, - Destination: &cfg.MachineAuthAPIKey, - }, - { - EnvVars: []string{"OCIS_URL", "OCS_IDM_ADDRESS"}, - Destination: &cfg.IdentityManagement.Address, - }, - { - EnvVars: []string{"STORAGE_USERS_DRIVER", "OCS_STORAGE_USERS_DRIVER"}, - Destination: &cfg.StorageUsersDriver, - }, - } -} diff --git a/ocs/pkg/logging/logging.go b/ocs/pkg/logging/logging.go new file mode 100644 index 0000000000..355ab6c0dd --- /dev/null +++ b/ocs/pkg/logging/logging.go @@ -0,0 +1,17 @@ +package logging + +import ( + "github.com/owncloud/ocis/ocis-pkg/log" + "github.com/owncloud/ocis/ocs/pkg/config" +) + +// LoggerFromConfig initializes a service-specific logger instance. +func Configure(name string, cfg config.Log) log.Logger { + return log.NewLogger( + log.Name(name), + log.Level(cfg.Level), + log.Pretty(cfg.Pretty), + log.Color(cfg.Color), + log.File(cfg.File), + ) +} diff --git a/ocs/pkg/server/http/svc_test.go b/ocs/pkg/server/http/svc_test.go index 3a0e540355..7f641022b7 100644 --- a/ocs/pkg/server/http/svc_test.go +++ b/ocs/pkg/server/http/svc_test.go @@ -14,8 +14,6 @@ import ( "strings" "testing" - "github.com/owncloud/ocis/ocis-pkg/shared" - user "github.com/cs3org/go-cs3apis/cs3/identity/user/v1beta1" types "github.com/cs3org/go-cs3apis/cs3/types/v1beta1" "github.com/cs3org/reva/pkg/auth/scope" @@ -23,10 +21,10 @@ import ( "github.com/cs3org/reva/pkg/token/manager/jwt" "github.com/golang/protobuf/ptypes/empty" accountsCfg "github.com/owncloud/ocis/accounts/pkg/config" + accountsLogging "github.com/owncloud/ocis/accounts/pkg/logging" accountsProto "github.com/owncloud/ocis/accounts/pkg/proto/v0" accountsSvc "github.com/owncloud/ocis/accounts/pkg/service/v0" ocisLog "github.com/owncloud/ocis/ocis-pkg/log" - oclog "github.com/owncloud/ocis/ocis-pkg/log" "github.com/owncloud/ocis/ocis-pkg/service/grpc" "github.com/owncloud/ocis/ocs/pkg/config" svc "github.com/owncloud/ocis/ocs/pkg/service/v0" @@ -549,7 +547,7 @@ func init() { Path: dataPath, }, }, - Log: &shared.Log{ + Log: accountsCfg.Log{ Level: "info", Pretty: true, Color: true, @@ -560,7 +558,7 @@ func init() { var err error if hdlr, err = accountsSvc.New( - accountsSvc.Logger(oclog.LoggerFromConfig("accounts", *c.Log)), + accountsSvc.Logger(accountsLogging.Configure("accounts", c.Log)), accountsSvc.Config(c), accountsSvc.RoleService(buildRoleServiceMock()), ); err != nil { @@ -696,7 +694,7 @@ func getService() svc.Service { TokenManager: config.TokenManager{ JWTSecret: jwtSecret, }, - Log: &shared.Log{ + Log: config.Log{ Level: "debug", }, } diff --git a/settings/pkg/config/config.go b/settings/pkg/config/config.go index 113beb8cb1..4b46a8da84 100644 --- a/settings/pkg/config/config.go +++ b/settings/pkg/config/config.go @@ -70,7 +70,6 @@ type TokenManager struct { type Config struct { *shared.Commons - File string `ocisConfig:"file"` Service Service `ocisConfig:"service"` Log *shared.Log `ocisConfig:"log"` Debug Debug `ocisConfig:"debug"` diff --git a/storage/pkg/config/config.go b/storage/pkg/config/config.go index 6691edda40..f01a049d84 100644 --- a/storage/pkg/config/config.go +++ b/storage/pkg/config/config.go @@ -508,7 +508,6 @@ type Asset struct { type Config struct { *shared.Commons - File string `ocisConfig:"file"` Log *shared.Log `ocisConfig:"log"` Debug Debug `ocisConfig:"debug"` Reva Reva `ocisConfig:"reva"` diff --git a/store/pkg/config/config.go b/store/pkg/config/config.go index 3131492b61..cdb9d23be9 100644 --- a/store/pkg/config/config.go +++ b/store/pkg/config/config.go @@ -40,7 +40,6 @@ type Tracing struct { // Config combines all available configuration parts. type Config struct { - File string `ocisConfig:"file"` Log shared.Log `ocisConfig:"log"` Debug Debug `ocisConfig:"debug"` GRPC GRPC `ocisConfig:"grpc"` diff --git a/web/pkg/config/config.go b/web/pkg/config/config.go index 210b52918d..222c93cd23 100644 --- a/web/pkg/config/config.go +++ b/web/pkg/config/config.go @@ -94,7 +94,6 @@ type Web struct { type Config struct { *shared.Commons - File string `ocisConfig:"file"` Log *shared.Log `ocisConfig:"log"` Debug Debug `ocisConfig:"debug"` HTTP HTTP `ocisConfig:"http"`