fix individual idp command
This commit is contained in:
@@ -3,15 +3,12 @@ package command
|
|||||||
import (
|
import (
|
||||||
"github.com/owncloud/ocis/idp/pkg/command"
|
"github.com/owncloud/ocis/idp/pkg/command"
|
||||||
"github.com/owncloud/ocis/ocis-pkg/config"
|
"github.com/owncloud/ocis/ocis-pkg/config"
|
||||||
"github.com/owncloud/ocis/ocis-pkg/shared"
|
|
||||||
"github.com/owncloud/ocis/ocis/pkg/register"
|
"github.com/owncloud/ocis/ocis/pkg/register"
|
||||||
"github.com/urfave/cli/v2"
|
"github.com/urfave/cli/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
// IDPCommand is the entrypoint for the idp command.
|
// IDPCommand is the entrypoint for the idp command.
|
||||||
func IDPCommand(cfg *config.Config) *cli.Command {
|
func IDPCommand(cfg *config.Config) *cli.Command {
|
||||||
var globalLog shared.Log
|
|
||||||
|
|
||||||
return &cli.Command{
|
return &cli.Command{
|
||||||
Name: "idp",
|
Name: "idp",
|
||||||
Usage: "Start idp server",
|
Usage: "Start idp server",
|
||||||
@@ -24,16 +21,13 @@ func IDPCommand(cfg *config.Config) *cli.Command {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
globalLog = cfg.Log
|
if cfg.Commons != nil {
|
||||||
|
cfg.IDP.Commons = cfg.Commons
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
Action: func(c *cli.Context) error {
|
Action: func(c *cli.Context) error {
|
||||||
// if idp logging is empty in ocis.yaml
|
|
||||||
if (cfg.IDP.Log == shared.Log{}) && (globalLog != shared.Log{}) {
|
|
||||||
// we can safely inherit the global logging values.
|
|
||||||
cfg.IDP.Log = globalLog
|
|
||||||
}
|
|
||||||
idpCommand := command.Server(cfg.IDP)
|
idpCommand := command.Server(cfg.IDP)
|
||||||
if err := idpCommand.Before(c); err != nil {
|
if err := idpCommand.Before(c); err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user