From ad43ae824c15ad333892c1020d6479a3ec35d1bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Fri, 25 Oct 2024 01:01:03 +0200 Subject: [PATCH] delete unused trap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- ocis-pkg/sync/trap.go | 21 ------------------- services/app-provider/pkg/command/server.go | 5 ----- services/app-provider/pkg/config/config.go | 3 +-- services/app-registry/pkg/config/config.go | 3 +-- services/auth-app/pkg/command/server.go | 5 ----- services/auth-app/pkg/config/config.go | 3 +-- services/auth-basic/pkg/command/server.go | 5 ----- services/auth-basic/pkg/config/config.go | 3 +-- services/auth-bearer/pkg/command/server.go | 5 ----- services/auth-bearer/pkg/config/config.go | 3 +-- services/auth-machine/pkg/command/server.go | 5 ----- services/auth-machine/pkg/config/config.go | 3 +-- services/auth-service/pkg/command/server.go | 5 ----- services/auth-service/pkg/config/config.go | 3 +-- services/frontend/pkg/command/server.go | 5 ----- services/frontend/pkg/config/config.go | 3 +-- services/gateway/pkg/config/config.go | 3 +-- services/groups/pkg/command/server.go | 5 ----- services/groups/pkg/config/config.go | 3 +-- services/ocm/pkg/command/server.go | 5 ----- services/ocm/pkg/config/config.go | 3 +-- services/sharing/pkg/command/server.go | 5 ----- services/sharing/pkg/config/config.go | 5 ++--- .../storage-publiclink/pkg/command/server.go | 5 ----- .../storage-publiclink/pkg/config/config.go | 3 +-- services/storage-shares/pkg/command/server.go | 5 ----- services/storage-shares/pkg/config/config.go | 3 +-- services/storage-system/pkg/command/server.go | 5 ----- services/storage-system/pkg/config/config.go | 3 +-- services/storage-users/pkg/command/server.go | 5 ----- services/storage-users/pkg/config/config.go | 3 +-- services/users/pkg/command/server.go | 5 ----- services/users/pkg/config/config.go | 3 +-- 33 files changed, 18 insertions(+), 131 deletions(-) delete mode 100644 ocis-pkg/sync/trap.go diff --git a/ocis-pkg/sync/trap.go b/ocis-pkg/sync/trap.go deleted file mode 100644 index 13eb08a47..000000000 --- a/ocis-pkg/sync/trap.go +++ /dev/null @@ -1,21 +0,0 @@ -package sync - -import ( - "context" - "os" - "os/signal" - - "github.com/oklog/run" -) - -// Trap listens to interrupt signals and handles context cancellation and channel closing on a group run. -func Trap(gr *run.Group, cancel context.CancelFunc) { - stop := make(chan os.Signal, 1) - gr.Add(func() error { - signal.Notify(stop, os.Interrupt) - <-stop - return nil - }, func(err error) { - cancel() - }) -} diff --git a/services/app-provider/pkg/command/server.go b/services/app-provider/pkg/command/server.go index 6d0a044ae..28a7f89b7 100644 --- a/services/app-provider/pkg/command/server.go +++ b/services/app-provider/pkg/command/server.go @@ -11,7 +11,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/app-provider/pkg/config" @@ -77,10 +76,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/app-provider/pkg/config/config.go b/services/app-provider/pkg/config/config.go index 2bce38296..1c422ab21 100644 --- a/services/app-provider/pkg/config/config.go +++ b/services/app-provider/pkg/config/config.go @@ -22,8 +22,7 @@ type Config struct { Driver string `yaml:"driver" env:"APP_PROVIDER_DRIVER" desc:"Driver, the APP PROVIDER services uses. Only 'wopi' is supported as of now." introductionVersion:"pre5.0"` Drivers Drivers `yaml:"drivers"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/app-registry/pkg/config/config.go b/services/app-registry/pkg/config/config.go index 4a385e09d..15c212539 100644 --- a/services/app-registry/pkg/config/config.go +++ b/services/app-registry/pkg/config/config.go @@ -21,8 +21,7 @@ type Config struct { AppRegistry AppRegistry `yaml:"app_registry"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/auth-app/pkg/command/server.go b/services/auth-app/pkg/command/server.go index 00b752887..10ba77b1c 100644 --- a/services/auth-app/pkg/command/server.go +++ b/services/auth-app/pkg/command/server.go @@ -13,7 +13,6 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" ogrpc "github.com/owncloud/ocis/v2/ocis-pkg/service/grpc" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" settingssvc "github.com/owncloud/ocis/v2/protogen/gen/ocis/services/settings/v0" @@ -86,10 +85,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/auth-app/pkg/config/config.go b/services/auth-app/pkg/config/config.go index 2171c21a1..ef7cc1ebe 100644 --- a/services/auth-app/pkg/config/config.go +++ b/services/auth-app/pkg/config/config.go @@ -28,8 +28,7 @@ type Config struct { AllowImpersonation bool `yaml:"allow_impersonation" env:"AUTH_APP_ENABLE_IMPERSONATION" desc:"Allows admins to create app tokens for other users. Used for migration. Do NOT use in productive deployments." introductionVersion:"7.0.0"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } // Log defines the loging configuration diff --git a/services/auth-basic/pkg/command/server.go b/services/auth-basic/pkg/command/server.go index 475f5333b..a6d7d95ec 100644 --- a/services/auth-basic/pkg/command/server.go +++ b/services/auth-basic/pkg/command/server.go @@ -12,7 +12,6 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/ldap" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/auth-basic/pkg/config" @@ -91,10 +90,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/auth-basic/pkg/config/config.go b/services/auth-basic/pkg/config/config.go index 5c1558679..65aa3bc22 100644 --- a/services/auth-basic/pkg/config/config.go +++ b/services/auth-basic/pkg/config/config.go @@ -22,8 +22,7 @@ type Config struct { AuthProvider string `yaml:"auth_provider" env:"AUTH_BASIC_AUTH_MANAGER" desc:"The authentication manager to check if credentials are valid. Supported value is 'ldap'." introductionVersion:"pre5.0"` AuthProviders AuthProviders `yaml:"auth_providers"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/auth-bearer/pkg/command/server.go b/services/auth-bearer/pkg/command/server.go index 76877780e..e6d93f7a2 100644 --- a/services/auth-bearer/pkg/command/server.go +++ b/services/auth-bearer/pkg/command/server.go @@ -11,7 +11,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/auth-bearer/pkg/config" @@ -78,10 +77,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/auth-bearer/pkg/config/config.go b/services/auth-bearer/pkg/config/config.go index 57a2db3f9..c09ddbaae 100644 --- a/services/auth-bearer/pkg/config/config.go +++ b/services/auth-bearer/pkg/config/config.go @@ -22,8 +22,7 @@ type Config struct { OIDC OIDC `yaml:"oidc"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/auth-machine/pkg/command/server.go b/services/auth-machine/pkg/command/server.go index 06a315d1d..d5d996c9a 100644 --- a/services/auth-machine/pkg/command/server.go +++ b/services/auth-machine/pkg/command/server.go @@ -11,7 +11,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/auth-machine/pkg/config" @@ -78,10 +77,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/auth-machine/pkg/config/config.go b/services/auth-machine/pkg/config/config.go index b92a860b5..4c1c01b0c 100644 --- a/services/auth-machine/pkg/config/config.go +++ b/services/auth-machine/pkg/config/config.go @@ -22,8 +22,7 @@ type Config struct { MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;AUTH_MACHINE_API_KEY" desc:"Machine auth API key used to validate internal requests necessary for the access to resources from other services." introductionVersion:"pre5.0"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/auth-service/pkg/command/server.go b/services/auth-service/pkg/command/server.go index 35816e780..e01773cca 100644 --- a/services/auth-service/pkg/command/server.go +++ b/services/auth-service/pkg/command/server.go @@ -11,7 +11,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/auth-service/pkg/config" @@ -79,10 +78,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/auth-service/pkg/config/config.go b/services/auth-service/pkg/config/config.go index 4c6242624..d3be2fe26 100644 --- a/services/auth-service/pkg/config/config.go +++ b/services/auth-service/pkg/config/config.go @@ -21,8 +21,7 @@ type Config struct { // TODO: when using multiple service accounts we need to find a way to configure them ServiceAccount ServiceAccount `yaml:"service_account"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/frontend/pkg/command/server.go b/services/frontend/pkg/command/server.go index 8f936935f..ece624101 100644 --- a/services/frontend/pkg/command/server.go +++ b/services/frontend/pkg/command/server.go @@ -11,7 +11,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/frontend/pkg/config" @@ -82,10 +81,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - httpSvc := registry.BuildHTTPService(cfg.HTTP.Namespace+"."+cfg.Service.Name, cfg.HTTP.Addr, version.GetString()) if err := registry.RegisterService(ctx, httpSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the http service") diff --git a/services/frontend/pkg/config/config.go b/services/frontend/pkg/config/config.go index 626d85a57..d4e2b51d5 100644 --- a/services/frontend/pkg/config/config.go +++ b/services/frontend/pkg/config/config.go @@ -58,8 +58,7 @@ type Config struct { PasswordPolicy PasswordPolicy `yaml:"password_policy"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/gateway/pkg/config/config.go b/services/gateway/pkg/config/config.go index 081e05421..53699fccc 100644 --- a/services/gateway/pkg/config/config.go +++ b/services/gateway/pkg/config/config.go @@ -48,8 +48,7 @@ type Config struct { StorageRegistry StorageRegistry `yaml:"storage_registry"` // TODO: should we even support switching this? - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/groups/pkg/command/server.go b/services/groups/pkg/command/server.go index f79bc953e..36c83a03b 100644 --- a/services/groups/pkg/command/server.go +++ b/services/groups/pkg/command/server.go @@ -12,7 +12,6 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/ldap" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/groups/pkg/config" @@ -91,10 +90,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/groups/pkg/config/config.go b/services/groups/pkg/config/config.go index fa6804aa7..2219fbab2 100644 --- a/services/groups/pkg/config/config.go +++ b/services/groups/pkg/config/config.go @@ -23,8 +23,7 @@ type Config struct { Driver string `yaml:"driver" env:"GROUPS_DRIVER" desc:"The driver which should be used by the groups service. Supported values are 'ldap' and 'owncloudsql'." introductionVersion:"pre5.0"` Drivers Drivers `yaml:"drivers"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/ocm/pkg/command/server.go b/services/ocm/pkg/command/server.go index 7e7265b06..64fced688 100644 --- a/services/ocm/pkg/command/server.go +++ b/services/ocm/pkg/command/server.go @@ -11,7 +11,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/ocm/pkg/config" @@ -79,10 +78,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/ocm/pkg/config/config.go b/services/ocm/pkg/config/config.go index db50077e9..75c292d91 100644 --- a/services/ocm/pkg/config/config.go +++ b/services/ocm/pkg/config/config.go @@ -38,8 +38,7 @@ type Config struct { OCMCore OCMCore `yaml:"ocm_core"` OCMStorageProvider OCMStorageProvider `yaml:"ocm_storage_provider"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } // HTTPConfig defines the available http configuration. diff --git a/services/sharing/pkg/command/server.go b/services/sharing/pkg/command/server.go index 73292fd3c..94d91a91c 100644 --- a/services/sharing/pkg/command/server.go +++ b/services/sharing/pkg/command/server.go @@ -12,7 +12,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/sharing/pkg/config" @@ -94,10 +93,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/sharing/pkg/config/config.go b/services/sharing/pkg/config/config.go index cbb05888c..89501e7a3 100644 --- a/services/sharing/pkg/config/config.go +++ b/services/sharing/pkg/config/config.go @@ -28,10 +28,9 @@ type Config struct { WriteableShareMustHavePassword bool `yaml:"public_sharing_writeableshare_must_have_password" env:"OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD;SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD" desc:"Set this to true if you want to enforce passwords on Uploader, Editor or Contributor shares. If not using the global OCIS_SHARING_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD, you must define the FRONTEND_OCS_PUBLIC_WRITEABLE_SHARE_MUST_HAVE_PASSWORD in the frontend service." introductionVersion:"5.0"` PublicShareMustHavePassword bool `yaml:"public_sharing_share_must_have_password" env:"OCIS_SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD;SHARING_PUBLIC_SHARE_MUST_HAVE_PASSWORD" desc:"Set this to true if you want to enforce passwords on all public shares." introductionVersion:"5.0"` EnableExpiredSharesCleanup bool `yaml:"enable_expired_shares_cleanup"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + PasswordPolicy PasswordPolicy `yaml:"password_policy"` - PasswordPolicy PasswordPolicy `yaml:"password_policy"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/storage-publiclink/pkg/command/server.go b/services/storage-publiclink/pkg/command/server.go index d15dac8ce..9a0c39916 100644 --- a/services/storage-publiclink/pkg/command/server.go +++ b/services/storage-publiclink/pkg/command/server.go @@ -11,7 +11,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/storage-publiclink/pkg/config" @@ -78,10 +77,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/storage-publiclink/pkg/config/config.go b/services/storage-publiclink/pkg/config/config.go index ba35b2123..c6cab3d60 100644 --- a/services/storage-publiclink/pkg/config/config.go +++ b/services/storage-publiclink/pkg/config/config.go @@ -22,8 +22,7 @@ type Config struct { StorageProvider StorageProvider `yaml:"storage_provider"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { diff --git a/services/storage-shares/pkg/command/server.go b/services/storage-shares/pkg/command/server.go index 41757ff57..7ed4bec25 100644 --- a/services/storage-shares/pkg/command/server.go +++ b/services/storage-shares/pkg/command/server.go @@ -11,7 +11,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/storage-shares/pkg/config" @@ -78,10 +77,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/storage-shares/pkg/config/config.go b/services/storage-shares/pkg/config/config.go index a16664600..b6f7b8e8d 100644 --- a/services/storage-shares/pkg/config/config.go +++ b/services/storage-shares/pkg/config/config.go @@ -24,8 +24,7 @@ type Config struct { ReadOnly bool `yaml:"readonly" env:"STORAGE_SHARES_READ_ONLY" desc:"Set this storage to be read-only." introductionVersion:"pre5.0"` SharesProviderEndpoint string `yaml:"user_share_provider_endpoint" env:"STORAGE_SHARES_USER_SHARE_PROVIDER_ENDPOINT" desc:"GRPC endpoint of the SHARING service." introductionVersion:"pre5.0"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { Level string `yaml:"level" env:"OCIS_LOG_LEVEL;STORAGE_SHARES_LOG_LEVEL" desc:"The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'." introductionVersion:"pre5.0"` diff --git a/services/storage-system/pkg/command/server.go b/services/storage-system/pkg/command/server.go index 2b50a59a0..2c2e058cb 100644 --- a/services/storage-system/pkg/command/server.go +++ b/services/storage-system/pkg/command/server.go @@ -11,7 +11,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/storage-system/pkg/config" @@ -78,10 +77,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/storage-system/pkg/config/config.go b/services/storage-system/pkg/config/config.go index 5b3679751..e215ba6e6 100644 --- a/services/storage-system/pkg/config/config.go +++ b/services/storage-system/pkg/config/config.go @@ -31,8 +31,7 @@ type Config struct { Drivers Drivers `yaml:"drivers"` DataServerURL string `yaml:"data_server_url" env:"STORAGE_SYSTEM_DATA_SERVER_URL" desc:"URL of the data server, needs to be reachable by other services using this service." introductionVersion:"pre5.0"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } // Log holds Log config diff --git a/services/storage-users/pkg/command/server.go b/services/storage-users/pkg/command/server.go index f88ed590c..db64d57a3 100644 --- a/services/storage-users/pkg/command/server.go +++ b/services/storage-users/pkg/command/server.go @@ -12,7 +12,6 @@ import ( "github.com/oklog/run" "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/storage-users/pkg/config" @@ -80,10 +79,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/storage-users/pkg/config/config.go b/services/storage-users/pkg/config/config.go index 690e94806..6a65fd1c3 100644 --- a/services/storage-users/pkg/config/config.go +++ b/services/storage-users/pkg/config/config.go @@ -45,8 +45,7 @@ type Config struct { MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;STORAGE_USERS_MACHINE_AUTH_API_KEY" desc:"Machine auth API key used to validate internal requests necessary for the access to resources from other services." introductionVersion:"5.0"` CliMaxAttemptsRenameFile int `yaml:"max_attempts_rename_file" env:"STORAGE_USERS_CLI_MAX_ATTEMPTS_RENAME_FILE" desc:"The maximum number of attempts to rename a file when a user restores a file to an existing destination with the same name. The minimum value is 100." introductionVersion:"5.0"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } // Log configures the logging diff --git a/services/users/pkg/command/server.go b/services/users/pkg/command/server.go index aed4caa14..115b58af3 100644 --- a/services/users/pkg/command/server.go +++ b/services/users/pkg/command/server.go @@ -12,7 +12,6 @@ import ( "github.com/owncloud/ocis/v2/ocis-pkg/config/configlog" "github.com/owncloud/ocis/v2/ocis-pkg/ldap" "github.com/owncloud/ocis/v2/ocis-pkg/registry" - "github.com/owncloud/ocis/v2/ocis-pkg/sync" "github.com/owncloud/ocis/v2/ocis-pkg/tracing" "github.com/owncloud/ocis/v2/ocis-pkg/version" "github.com/owncloud/ocis/v2/services/users/pkg/config" @@ -91,10 +90,6 @@ func Server(cfg *config.Config) *cli.Command { cancel() }) - if !cfg.Supervised { - sync.Trap(&gr, cancel) - } - grpcSvc := registry.BuildGRPCService(cfg.GRPC.Namespace+"."+cfg.Service.Name, cfg.GRPC.Protocol, cfg.GRPC.Addr, version.GetString()) if err := registry.RegisterService(ctx, grpcSvc, logger); err != nil { logger.Fatal().Err(err).Msg("failed to register the grpc service") diff --git a/services/users/pkg/config/config.go b/services/users/pkg/config/config.go index e6c7ddfdf..6383ac1b9 100644 --- a/services/users/pkg/config/config.go +++ b/services/users/pkg/config/config.go @@ -23,8 +23,7 @@ type Config struct { Driver string `yaml:"driver" env:"USERS_DRIVER" desc:"The driver which should be used by the users service. Supported values are 'ldap' and 'owncloudsql'." introductionVersion:"pre5.0"` Drivers Drivers `yaml:"drivers"` - Supervised bool `yaml:"-"` - Context context.Context `yaml:"-"` + Context context.Context `yaml:"-"` } type Log struct { Level string `yaml:"level" env:"OCIS_LOG_LEVEL;USERS_LOG_LEVEL" desc:"The log level. Valid values are: 'panic', 'fatal', 'error', 'warn', 'info', 'debug', 'trace'." introductionVersion:"pre5.0"`