Skip to content

Commit

Permalink
Keyname overhaul
Browse files Browse the repository at this point in the history
Squashed (and fixed) commit of the following:

commit 541e404
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Fri Oct 23 17:50:26 2020 +0200

    proposal and demo for new api

commit 29fb355
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Oct 20 21:11:01 2020 +0200

    add TODO

commit b169534
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Mon Oct 12 17:25:38 2020 +0200

    fix footnote

commit 60c508b
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Oct 11 16:55:20 2020 +0200

    add TODO

commit 7da783d
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Oct 11 16:44:46 2020 +0200

    Remove keyIsInactive and plugin 'hidden'

commit 2f167d5
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Fri Oct 9 14:38:56 2020 +0200

    Update release notes

commit 1429765
Author: kodebach <23529132+kodebach@users.noreply.github.com>
Date:   Mon Oct 12 17:25:24 2020 +0200

    Apply suggestions from code review

    Co-authored-by: markus2330 <markus2330@users.noreply.github.com>

commit 2fdb2dc
Author: kodebach <23529132+kodebach@users.noreply.github.com>
Date:   Sun Oct 11 20:28:12 2020 +0200

    Apply suggestions from code review

    Co-authored-by: markus2330 <markus2330@users.noreply.github.com>

commit 3ae0fb7
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sat Oct 3 21:32:05 2020 +0200

    fix spelling

commit 6feba9c
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sat Oct 3 20:51:13 2020 +0200

    Finish new documentation and extend release notes

commit a026717
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sat Oct 3 14:08:19 2020 +0200

    Add Key Name documentation

    - Add a Python reference implementation
    - Start documentation README

commit 6120185
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sat Oct 3 00:57:21 2020 +0200

    ccode: fix oclint issue

commit 495410c
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Fri Oct 2 20:34:50 2020 +0200

    fix bug in keyname validation

commit 0616290
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Fri Oct 2 18:36:12 2020 +0200

    ccode: fix en-/decoding bug

commit abe9dd7
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Fri Oct 2 15:41:35 2020 +0200

    Update shell test data

commit 8b47125
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 29 20:21:29 2020 +0200

    Update release notes

commit f90ec81
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 29 20:11:44 2020 +0200

    fix swig compile flags

commit 4403f12
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Mon Sep 28 20:13:22 2020 +0200

    Update Keynames proposal

commit 76c5529
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Wed Sep 23 20:19:30 2020 +0200

    update some bits of the C++ binding

commit 6edcb87
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Wed Sep 23 18:53:56 2020 +0200

    update TODOs

commit f42102b
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Wed Sep 23 18:29:12 2020 +0200

    remove various deprecated things

commit 3a63e42
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Wed Sep 23 18:12:56 2020 +0200

    fix website build

commit 151f770
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Wed Sep 23 00:53:18 2020 +0200

    fix oclint errors

commit bb90d37
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 23:38:20 2020 +0200

    fix oclint errors

commit e5a0611
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 22:28:17 2020 +0200

    fix oclint errors (again)

commit b9a5021
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 22:21:38 2020 +0200

    Revert "Revert "adapt ruby code to work with ruby 2.3""

    This reverts commit 2e8f936.

commit 25a788e
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 22:21:35 2020 +0200

    Revert "fix oclint errors"

    This reverts commit 8703b05.

commit 5865fa6
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 22:21:32 2020 +0200

    Revert "fix ccode"

    This reverts commit ffebe18.

commit 7e7de68
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 21:37:04 2020 +0200

    Revert "adapt ruby code to work with ruby 2.3"

    This reverts commit eebd51a.

commit 4703b86
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 21:02:52 2020 +0200

    adapt ruby code to work with ruby 2.3

commit ca687a9
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 20:57:08 2020 +0200

    fix ccode

commit d54ed1a
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 20:54:09 2020 +0200

    fix oclint errors

commit 8eb9717
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 18:50:29 2020 +0200

    fix JNA keyCmp

commit 2c1850e
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 18:09:55 2020 +0200

    remove TODO

commit b6894d4
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 18:03:51 2020 +0200

    fix disabled pythongen

commit 291dded
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 18:01:29 2020 +0200

    remove debian-stretch-full-ini Jenkins job

commit e8e6d4b
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 18:00:05 2020 +0200

    add ELEKTRA_NO_SANITIZE_ADDRESS for gcc

commit 0e7890c
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 17:55:31 2020 +0200

    fully disable pythongen

commit 85d7224
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Tue Sep 22 17:50:12 2020 +0200

    disable more santizers in opmphmHashfunction

commit 63c29ca
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 22:22:19 2020 +0200

    fix kdb gen

commit 1e47869
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 22:08:29 2020 +0200

    update man page

commit be60437
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 21:52:59 2020 +0200

    fix more keynames

commit 6d9be23
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 21:22:40 2020 +0200

    fix .gitignore and add missing files

commit 74d7229
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 21:07:26 2020 +0200

    fix javascript formatting

commit e59e9a5
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 20:50:02 2020 +0200

    update some files missed in rebase

commit d0102d7
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 20:00:58 2020 +0200

    remove some files

commit c9f0b99
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 20:00:28 2020 +0200

    Revert "undo changes to kdb-global-umount test"

    This reverts commit 3716959.

commit 6521996
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 19:15:11 2020 +0200

    fix testcpp_contextual_update

commit 350ad25
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 18:48:43 2020 +0200

    undo changes to kdb-global-umount test

commit 8390278
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 18:21:55 2020 +0200

    update TODOs

commit 529c2ec
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 18:02:11 2020 +0200

    fix kdb-global-umount

commit d93027f
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sun Sep 20 17:27:35 2020 +0200

    fix various memory problems

commit 1bf60ee
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sat Sep 5 16:57:55 2020 +0200

    java: fix after keyname overhaul

commit 33c2c53
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sat Sep 5 16:35:51 2020 +0200

    fix formatting

commit 0486d04
Author: Klemens Böswirth <k.boeswirth+git@gmail.com>
Date:   Sat May 30 14:34:43 2020 +0200

    Keyname overhaul

    Squashed version of 22ff913..3645f79
  • Loading branch information
kodebach committed Nov 20, 2020
1 parent 6bb3e2c commit d9a8478
Show file tree
Hide file tree
Showing 904 changed files with 20,505 additions and 18,796 deletions.
12 changes: 6 additions & 6 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ Please provide a step by step guide on how to reproduce the problem here. If pos
syntax:

```sh
kdb set user/tests/hello world
#> Create a new key user/tests/hello with string "world"
kdb set user:/tests/hello world
#> Create a new key user:/tests/hello with string "world"

kdb get user/tests/hello
kdb get user:/tests/hello
#> world

kdb get user/does/not/exist
kdb get user:/does/not/exist
# RET: 11
# STDERR: [Dd]id not find key 'user/does/not/exist'
# STDERR: [Dd]id not find key 'user:/does/not/exist'

kdb rm user/tests/hello
kdb rm user:/tests/hello
```

If your key database (KDB) might influence the outcome, please use `kdb stash`
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#ignore all build directories of cmake
build*/
cmake-build*/
!scripts/build/

#ignore ctags + gdb history files
.ctags
Expand Down
1 change: 1 addition & 0 deletions Testing/Temporary/CTestCostData.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
3 changes: 3 additions & 0 deletions Testing/Temporary/LastTest.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Start testing: Sep 05 13:14 CEST
----------------------------------------------------------
End testing: Sep 05 13:14 CEST
2 changes: 1 addition & 1 deletion benchmarks/benchmarks.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,7 +598,7 @@ KeySet * generateKeySet (const size_t size, int32_t * seed, KeySetShape * shape)
}
for (size_t i = 0; i < root->numberofChildren; ++i)
{
Key * key = keyNew ("", KEY_END);
Key * key = keyNew ("/", KEY_END);
if (!key)
{
printExit ("generateKeySet: Can not create Key");
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/benchmarks.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <time.h>

#define KEY_ROOT "user/benchmark"
#define KEY_ROOT "user:/benchmark"

#define KEY_NAME_LENGTH 1000
#define NUM_DIR 200
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/kdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ int main (void)
fprintf (stdout, "%s;%s;%s\n", "plugin", "operation", "microseconds");
{
KeySet * returned = ksNew (0, KS_END);
Key * parentKey = keyNew ("user", KEY_END);
Key * parentKey = keyNew ("user:/", KEY_END);

timeInit ();
KDB * handle = kdbOpen (parentKey);
Expand All @@ -49,7 +49,7 @@ int main (void)
for (size_t i = 0; i < NUM_RUNS; ++i)
{
timeInit ();
Key * parentKey = keyNew ("user/benchmark", KEY_END);
Key * parentKey = keyNew ("user:/benchmark", KEY_END);
KDB * handle = kdbOpen (parentKey);
fprintf (stdout, CSV_STR_FMT, "core", "kdbOpen", timeGetDiffMicroseconds ());

Expand Down
2 changes: 1 addition & 1 deletion benchmarks/memoryleak.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ int main (void)
KDB * handles[NUM_RUNS];
KeySet * keysets[NUM_RUNS];

Key * parentKey = keyNew ("user", KEY_END);
Key * parentKey = keyNew ("user:/", KEY_END);

for (size_t i = 0; i < NUM_RUNS; ++i)
{
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/opmphm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2461,7 +2461,7 @@ static void shapefCommonStartEnd (const size_t initSize ELEKTRA_UNUSED, size_t s
}
}
/**
* modules, level 1 keys same, one level 2 key stores the modules. Like system/elektra.
* modules, level 1 keys same, one level 2 key stores the modules. Like system:/elektra.
*/
static void * shapeModulesInit (void)
{
Expand Down Expand Up @@ -2496,13 +2496,13 @@ static void shapefModules (const size_t initSize, size_t size ELEKTRA_UNUSED, si
uint8_t * assign = &d[3];
if (level == 1)
{
// common start, simulates elektra in system/elektra
// common start, simulates elektra in system:/elektra
ret->subKeys = 1;
ret->label = 0;
}
else if (level == 2)
{
// common name, simulates modules in system/elektra/modules
// common name, simulates modules in system:/elektra/modules
// calculates how many modules have space
ret->subKeys = 0;
ssize_t remainingSize = initSize;
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/plugingetset.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ int main (int argc, char ** argv)
KeySet * conf = ksNew (0, KS_END);
KeySet * modules = ksNew (0, KS_END);
elektraModulesInit (modules, 0);
Key * errorKey = keyNew ("", KEY_END);
Key * errorKey = keyNew ("/", KEY_END);
Plugin * plugin = elektraPluginOpen (pluginname, modules, conf, errorKey);
keyDel (errorKey);

Expand All @@ -69,7 +69,7 @@ int main (int argc, char ** argv)
KeySet * conf = ksNew (0, KS_END);
KeySet * modules = ksNew (0, KS_END);
elektraModulesInit (modules, 0);
Key * errorKey = keyNew ("", KEY_END);
Key * errorKey = keyNew ("/", KEY_END);
Plugin * plugin = elektraPluginOpen (pluginname, modules, conf, errorKey);
keyDel (errorKey);
plugin->kdbSet (plugin, ks, setKey);
Expand Down
4 changes: 2 additions & 2 deletions benchmarks/storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static int benchmarkOpenPlugins (void)
modules[i] = ksNew (0, KS_END);
elektraModulesInit (modules[i], 0);
KeySet * conf = ksNew (0, KS_END);
Key * errorKey = keyNew ("", KEY_END);
Key * errorKey = keyNew ("/", KEY_END);
Plugin * plugin = elektraPluginOpen (pluginNames[i], modules[i], conf, errorKey);

const Key * metaWarnings = keyGetMeta (errorKey, "warnings");
Expand Down Expand Up @@ -102,7 +102,7 @@ int main (int argc, char ** argv)
init (argc, argv);

Plugin * plugin = plugins[i];
Key * parentKey = keyNew ("user/benchmarks/storage", KEY_VALUE, tmpfilename, KEY_END);
Key * parentKey = keyNew ("user:/benchmarks/storage", KEY_VALUE, tmpfilename, KEY_END);

for (size_t run = 0; run < NUM_RUNS; ++run)
{
Expand Down
2 changes: 1 addition & 1 deletion doc/METADATA.ini
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@ description= Internal metadata to be ignored by other plugins.
status= idea
description= states where a key comes from if it is not from an ordinary
persistent configuration. E.g. hardware (queries)
e.g. system/sw/xorg/current/monitor might have "source" metadata if it
e.g. system:/sw/xorg/current/monitor might have "source" metadata if it
is queried from hardware and not from configuration file.

[dependency/control]
Expand Down
14 changes: 7 additions & 7 deletions doc/TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,15 @@ You have some options to avoid running them as root:

```sh
kdb mount-info
echo `kdb sget system/info/elektra/constants/cmake/CMAKE_INSTALL_PREFIX .`/`kdb sget system/info/elektra/constants/cmake/KDB_DB_SPEC .`
echo `kdb sget system/info/elektra/constants/cmake/KDB_DB_SYSTEM .`
echo `kdb sget system:/info/elektra/constants/cmake/CMAKE_INSTALL_PREFIX .`/`kdb sget system:/info/elektra/constants/cmake/KDB_DB_SPEC .`
echo `kdb sget system:/info/elektra/constants/cmake/KDB_DB_SYSTEM .`
```

Then change the permissions:

```sh
chown -R `whoami` `kdb sget system/info/elektra/constants/cmake/CMAKE_INSTALL_PREFIX .`/`kdb sget system/info/elektra/constants/cmake/KDB_DB_SPEC .`
chown -R `whoami` `kdb sget system/info/elektra/constants/cmake/KDB_DB_SYSTEM .`
chown -R `whoami` `kdb sget system:/info/elektra/constants/cmake/CMAKE_INSTALL_PREFIX .`/`kdb sget system:/info/elektra/constants/cmake/KDB_DB_SPEC .`
chown -R `whoami` `kdb sget system:/info/elektra/constants/cmake/KDB_DB_SYSTEM .`
```

After that all test cases should run successfully as described above.
Expand Down Expand Up @@ -195,7 +195,7 @@ are expected to be in the README.md of the plugin.
- should not run, if `ENABLE_KDB_TESTING` is OFF.
- should only write below
- `/tests/<testname>` (e.g. `/tests/ruby`) and
- `system/elektra` (e.g. for mounts or globalplugins).
- `system:/elektra` (e.g. for mounts or globalplugins).
- Before executing tests, no keys must be present below `/tests`.
The test cases need to clean up everything they wrote.
(Including temporary files)
Expand Down Expand Up @@ -324,13 +324,13 @@ cp ~e/src/plugins/toml/toml/* testcase_dir
Fewer files is better. Then run, for example:

```sh
LD_LIBRARY_PATH=`pwd`/lib /usr/src/afl/AFL-2.57b/afl-fuzz -i testcase_dir -o findings_dir bin/kdb import user/tests toml
LD_LIBRARY_PATH=`pwd`/lib /usr/src/afl/AFL-2.57b/afl-fuzz -i testcase_dir -o findings_dir bin/kdb import user:/tests toml
```

Check if something is happening with:

```sh
watch kdb export user/tests
watch kdb export user:/tests
```

### ASAN
Expand Down
10 changes: 5 additions & 5 deletions doc/VERSION.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ numbers for the publicly announced versions.
The version can also be retrieved at run-time from KDB:

```
system/elektra/version/constants/KDB_VERSION
system/elektra/version/constants/KDB_VERSION_MAJOR
system/elektra/version/constants/KDB_VERSION_MINOR
system/elektra/version/constants/KDB_VERSION_PATCH
system:/elektra/version/constants/KDB_VERSION
system:/elektra/version/constants/KDB_VERSION_MAJOR
system:/elektra/version/constants/KDB_VERSION_MICRO
system:/elektra/version/constants/KDB_VERSION_MINOR
```

## Scope
Expand Down Expand Up @@ -136,7 +136,7 @@ know about which bug fixes are included.

The patch level might also be used to fix bugs within bindings.
This means that applications can only introspect the patch
level of Elektra by getting `system/elektra/version/constants/KDB_VERSION_PATCH`
level of Elektra by getting `system:/elektra/version/constants/KDB_VERSION_PATCH`
but not by static patch levels the binding might provide.
This should be no problem, as the patch level is supposed
to not change the behavior.
28 changes: 14 additions & 14 deletions doc/VISION.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ as desired.
Either by either invoking [command-line tools](/doc/help/kdb.md):

```sh
kdb set system/sw/samba/#0/current/global/workgroup MYGROUP
kdb set system:/sw/samba/#0/current/global/workgroup MYGROUP
```

Also by importing an INI file with the information:

```ini
kdb import system/sw/samba/#0/current ini << HERE
kdb import system:/sw/samba/#0/current ini << HERE
[global]
workgroup=MYGROUP
HERE
Expand All @@ -49,7 +49,7 @@ with neither code generation nor error handling):
int main ()
{
ElektraError* error;
Elektra * elektra = elektraOpen ("system/sw/samba/#0/current", 0, &error);
Elektra * elektra = elektraOpen ("system:/sw/samba/#0/current", 0, &error);
elektraSetString (elektra, "global/workgroup", "MYGROUP", &error);
elektraClose (elektra);
}
Expand All @@ -62,7 +62,7 @@ Or using some interpreted language like Python
import kdb
k = kdb.KDB()
ks = kdb.KeySet()
s = "system/sw/samba/#0/current"
s = "system:/sw/samba/#0/current"
k.get (ks, s)
ks.append(kdb.Key(s+"/global/workgroup", kdb.KEY_VALUE, "MYGROUP"))
k.set (ks, s)
Expand All @@ -75,7 +75,7 @@ change a configuration value.
Key-value access in [puppet-libelektra](https://puppet.libelektra.org):

```
kdbkey {'system/sw/samba/#0/current/global/workgroup':
kdbkey {'system:/sw/samba/#0/current/global/workgroup':
ensure => 'present',
value => 'MYGROUP'
}
Expand All @@ -84,7 +84,7 @@ kdbkey {'system/sw/samba/#0/current/global/workgroup':
Key-value access in Chef:

```
kdbset 'system/sw/samba/#0/current/global/workgroup' do
kdbset 'system:/sw/samba/#0/current/global/workgroup' do
value 'MYGROUP'
action :create
end
Expand All @@ -99,12 +99,12 @@ Key-value access in Ansible:
tasks:
- name: set workgroup
elektra:
key: "system/sw/samba/#0/current/global/workgroup"
key: "system:/sw/samba/#0/current/global/workgroup"
value: "MYGROUP"
```
In all these examples, we have set
`system/sw/samba/#0/current/global/workgroup` to `MYGROUP`.
`system:/sw/samba/#0/current/global/workgroup` to `MYGROUP`.

## Application Integration

Expand Down Expand Up @@ -148,7 +148,7 @@ shown above can be used. To make mounting more simple, we introduced an
extra tool:

```sh
kdb mount /etc/samba/smb.conf system/sw/samba/#0/current ini
kdb mount /etc/samba/smb.conf system:/sw/samba/#0/current ini
```

Mounting can also be done via configuration management
Expand All @@ -157,12 +157,12 @@ tools.
Mounting in puppet-libelektra:

```
kdbmount {'system/sw/samba/#0/current':
kdbmount {'system:/sw/samba/#0/current':
ensure => 'present',
file => '/etc/samba/smb.conf',
plugins => 'ini'
}
kdbkey {'system/sw/samba/global/log level':
kdbkey {'system:/sw/samba/global/log level':
ensure => 'absent'
}
```
Expand All @@ -176,7 +176,7 @@ Mounting in Ansible:
tasks:
- name: set workgroup
elektra:
mountpoint: system/sw/samba
mountpoint: system:/sw/samba
file: /etc/samba/smb.conf
plugins: ini
```
Expand Down Expand Up @@ -209,7 +209,7 @@ kdb set-meta /sw/samba/#0/current/global/workgroup description "This controls wh
Key-value specifications in [puppet-libelektra](https://puppet.libelektra.org):

```
kdbkey {'system/sw/samba/#0/current/global/workgroup':
kdbkey {'system:/sw/samba/#0/current/global/workgroup':
ensure => 'present',
check => {
'type' => 'string',
Expand All @@ -224,7 +224,7 @@ kdbkey {'system/sw/samba/#0/current/global/workgroup':
```

Note, that the specification (in both examples above) actually lands up in
`spec/sw/samba/#0/current/global/workgroup`. The unique path to the
`spec:/sw/samba/#0/current/global/workgroup`. The unique path to the
configuration setting is `/sw/samba/#0/current/global/workgroup`, but
the specification gets written to the [namespace](/doc/tutorials/namespaces.md)
`spec`, while the system-configuration gets written to the namespace `system`.
Expand Down
13 changes: 5 additions & 8 deletions doc/decisions/bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

Currently the default backend (default.ecf) will also be used for bootstrapping. There are two problems with this approach:

1. Thus the default backend first will be read with parentKey `system/elektra` and later with parentKey `system`, it needs to store absolute paths and thus won't work with the current INI plugin
1. Thus the default backend first will be read with parentKey `system:/elektra` and later with parentKey `system:/`, it needs to store absolute paths and thus won't work with most of the plugins (except dump).
2. When `system` is large without mount points, everything is reread twice during bootstrapping.

## Constraints
Expand All @@ -19,7 +19,7 @@ Currently the default backend (default.ecf) will also be used for bootstrapping.

## Considered Alternatives

- Implement a hack so that `system/elektra` is actually read as `system`. (Will not solve problem 2.)
- Implement a hack so that `system:/elektra` is actually read as `system:/`. (Will not solve problem 2.)
- Its a hack.
- Its confusing and does not play well with persistent data with relative key names.
- Split up without compatibility mode: would need to migrate all mount points by exporting (with old version!) and then importing (with new version!)
Expand All @@ -33,10 +33,8 @@ The default backend reading `default.ecf` is only relevant as long as no root ba

Algorithm:

1. try to get system/elektra using the file elektra.ecf (KDB_DB_INIT)
2. if it works, mount the init backend to system/elektra (non-fallback mode)
3. if it fails (== 0 or == -1), try default.ecf as fallback
4. if the fallback works (i.e. keys are present in system/elektra), mount the default backend to system/elektra (fallback mode)
1. try to get system:/elektra using the file elektra.ecf (KDB_DB_INIT)
2. if it works, mount the init backend to system:/elektra

## Rationale

Expand All @@ -46,7 +44,6 @@ Algorithm:

## Implications

- Fallback mode should be removed with 1.0
- added scripts/upgrade-bootstrap

## Related Decisions
Expand All @@ -56,4 +53,4 @@ Algorithm:
to upgrade to new system, either:

- touch /etc/kdb/elektra.ecf (loses old mount points)
- or do kdb export system/elektra/mountpoints, kdb rm -r system/elektra/mountpoints, kdb import system/elektra/mountpoints
- or do kdb export system:/elektra/mountpoints, kdb rm -r system:/elektra/mountpoints, kdb import system:/elektra/mountpoints
4 changes: 2 additions & 2 deletions doc/decisions/global_validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ with the respective `kdbGet`.

- global plugin can register additional backends to load
- split `kdbGet` into multiple steps:
1. do `kdbGet` on `system/elektra` to update mount points
2. first do `kdbGet` on the `spec/`-namespace
1. do `kdbGet` on `system:/elektra` to update mount points
2. first do `kdbGet` on the `spec:/`-namespace
3. then calculate which backends are needed
4. then fetch all backends as needed
- split loops in `kdbGet` not only according placements
Expand Down
Loading

0 comments on commit d9a8478

Please sign in to comment.