loadConfig pre-inspection in advance
Signed-off-by: helen <haitao.zhang@daocloud.io>
This commit is contained in:
parent
2654ece1d0
commit
a8bb1ad2a0
@ -132,6 +132,16 @@ can be used and modified as necessary as a custom configuration.`
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.GRPC.Address == "" {
|
||||||
|
return fmt.Errorf("grpc address cannot be empty: %w", errdefs.ErrInvalidArgument)
|
||||||
|
}
|
||||||
|
if config.TTRPC.Address == "" {
|
||||||
|
// If TTRPC was not explicitly configured, use defaults based on GRPC.
|
||||||
|
config.TTRPC.Address = config.GRPC.Address + ".ttrpc"
|
||||||
|
config.TTRPC.UID = config.GRPC.UID
|
||||||
|
config.TTRPC.GID = config.GRPC.GID
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure top-level directories are created early.
|
// Make sure top-level directories are created early.
|
||||||
if err := server.CreateTopLevelDirectories(config); err != nil {
|
if err := server.CreateTopLevelDirectories(config); err != nil {
|
||||||
return err
|
return err
|
||||||
@ -164,15 +174,6 @@ can be used and modified as necessary as a custom configuration.`
|
|||||||
log.G(ctx).WithError(w).Warn("cleanup temp mount")
|
log.G(ctx).WithError(w).Warn("cleanup temp mount")
|
||||||
}
|
}
|
||||||
|
|
||||||
if config.GRPC.Address == "" {
|
|
||||||
return fmt.Errorf("grpc address cannot be empty: %w", errdefs.ErrInvalidArgument)
|
|
||||||
}
|
|
||||||
if config.TTRPC.Address == "" {
|
|
||||||
// If TTRPC was not explicitly configured, use defaults based on GRPC.
|
|
||||||
config.TTRPC.Address = fmt.Sprintf("%s.ttrpc", config.GRPC.Address)
|
|
||||||
config.TTRPC.UID = config.GRPC.UID
|
|
||||||
config.TTRPC.GID = config.GRPC.GID
|
|
||||||
}
|
|
||||||
log.G(ctx).WithFields(logrus.Fields{
|
log.G(ctx).WithFields(logrus.Fields{
|
||||||
"version": version.Version,
|
"version": version.Version,
|
||||||
"revision": version.Revision,
|
"revision": version.Revision,
|
||||||
|
Loading…
Reference in New Issue
Block a user