Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small runtime cleanup #1066

Merged
merged 3 commits into from
Dec 11, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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