Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
c6dd714d
Commit
c6dd714d
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
feat: store path to config file in the config
parent
696d3d06
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!893
feat: --config parameter to specify picodata configuration file
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/config.rs
+10
-8
10 additions, 8 deletions
src/config.rs
with
10 additions
and
8 deletions
src/config.rs
+
10
−
8
View file @
c6dd714d
...
...
@@ -90,23 +90,26 @@ but a '{DEFAULT_CONFIG_FILE_NAME}' file in the current working directory '{cwd}'
Using configuration file '{args_path}'."
);
}
config
=
Some
(
Self
::
read_yaml_file
(
args_path
)
?
);
config
=
Some
(
(
Self
::
read_yaml_file
(
args_path
)
?
,
args_path
)
);
}
(
Some
(
args_path
),
false
)
=>
{
config
=
Some
(
Self
::
read_yaml_file
(
args_path
)
?
);
config
=
Some
(
(
Self
::
read_yaml_file
(
args_path
)
?
,
args_path
)
);
}
(
None
,
true
)
=>
{
#[rustfmt::skip]
tlog!
(
Info
,
"Reading configuration file '{DEFAULT_CONFIG_FILE_NAME}' in the current working directory '{cwd}'."
);
config
=
Some
(
Self
::
read_yaml_file
(
&
default_path
)
?
);
config
=
Some
(
(
Self
::
read_yaml_file
(
&
default_path
)
?
,
&
default_path
)
);
}
(
None
,
false
)
=>
{}
}
if
let
Some
(
config
)
=
&
config
{
let
mut
config
=
if
let
Some
(
(
mut
config
,
path
)
)
=
config
{
config
.validate_from_file
()
?
;
}
let
mut
config
=
config
.unwrap_or_default
();
config
.instance.config_file
=
Some
(
path
.clone
());
config
}
else
{
Default
::
default
()
};
config
.set_from_args
(
args
);
...
...
@@ -210,8 +213,6 @@ Using configuration file '{args_path}'.");
if
let
Some
(
memtx_memory
)
=
args
.memtx_memory
{
self
.instance.memtx_memory
=
Some
(
memtx_memory
);
}
// TODO: the rest
}
/// Does checks which are applicable to configuration loaded from a file.
...
...
@@ -435,6 +436,7 @@ impl ClusterConfig {
pub
struct
InstanceConfig
{
pub
data_dir
:
Option
<
String
>
,
pub
service_password_file
:
Option
<
String
>
,
pub
config_file
:
Option
<
String
>
,
pub
cluster_id
:
Option
<
String
>
,
pub
instance_id
:
Option
<
String
>
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment