Skip to content

Commit

Permalink
Merge pull request #1066 from owncloud/runtime-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
refs authored Dec 11, 2020
2 parents ea2a2b3 + 7bba6bc commit 0dfdcd7
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion accounts/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/runtime-cleanup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Runtime Cleanup

Small runtime cleanup prior to Tech Preview release

https://github.com/owncloud/ocis/pull/1066
2 changes: 1 addition & 1 deletion glauth/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down
2 changes: 1 addition & 1 deletion konnectd/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down
2 changes: 1 addition & 1 deletion ocis-phoenix/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down
2 changes: 1 addition & 1 deletion ocis/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down
18 changes: 16 additions & 2 deletions ocis/pkg/runtime/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ var (
// Extensions are ocis extension services
Extensions = []string{
"glauth",
"graph",
"graph-explorer",
"konnectd",
"ocs",
"onlyoffice",
Expand All @@ -54,6 +52,8 @@ var (
"storage-public-link",
"thumbnails",
"webdav",
//"graph",
//"graph-explorer",
}

// There seem to be a race condition when reva-sharing needs to read the sharing.json file and the parent folder is not present.
Expand Down Expand Up @@ -129,6 +129,11 @@ OUT:
func RunService(client *rpc.Client, service string) int {
args := process.NewProcEntry(service, os.Environ(), []string{service}...)

all := append(Extensions, append(dependants, MicroServices...)...)
if !contains(all, service) {
return 1
}

var reply int
if err := client.Call("Service.Start", args, &reply); err != nil {
golog.Fatal(err)
Expand Down Expand Up @@ -159,3 +164,12 @@ func setDefaults() {
// registry
registry.Name = OwncloudNamespace + "registry"
}

func contains(a []string, b string) bool {
for i := range a {
if a[i] == b {
return true
}
}
return false
}
2 changes: 1 addition & 1 deletion ocs/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down
2 changes: 1 addition & 1 deletion settings/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down
2 changes: 1 addition & 1 deletion storage/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func Execute() error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down
2 changes: 1 addition & 1 deletion store/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down
2 changes: 1 addition & 1 deletion thumbnails/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down
2 changes: 1 addition & 1 deletion webdav/pkg/command/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func ParseConfig(c *cli.Context, cfg *config.Config) error {
if err := viper.ReadInConfig(); err != nil {
switch err.(type) {
case viper.ConfigFileNotFoundError:
logger.Info().
logger.Debug().
Msg("no config found on preconfigured location")
case viper.UnsupportedConfigError:
logger.Fatal().
Expand Down

0 comments on commit 0dfdcd7

Please sign in to comment.