Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

kdb set with validation #1164

Closed
Tracked by #4431
markus2330 opened this issue Dec 3, 2016 · 27 comments
Closed
Tracked by #4431

kdb set with validation #1164

markus2330 opened this issue Dec 3, 2016 · 27 comments
Assignees
Labels
Milestone

Comments

@markus2330
Copy link
Contributor

markus2330 commented Dec 3, 2016

kdb set: always do cascading set (for validation)

Current behavior

kdb set user:/test value

does not validate.

Expected behavior

kdb set user:/test value should validate (except if -f is used)

@markus2330 markus2330 added this to the 0.8.20 milestone Dec 3, 2016
@markus2330 markus2330 self-assigned this Dec 3, 2016
@markus2330 markus2330 removed their assignment Aug 2, 2017
@markus2330 markus2330 removed this from the 0.8.20 milestone Oct 13, 2017
@markus2330 markus2330 added this to the 0.9.0 milestone Jan 26, 2019
@kodebach
Copy link
Member

Other problems with kdb set are:

  • internal/** metadata is not removed
  • origvalue metadata is not removed (breaks all future kdb get, until it is removed)

@stale
Copy link

stale bot commented Sep 28, 2020

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@stale stale bot added the stale label Sep 28, 2020
@markus2330 markus2330 removed the stale label Sep 29, 2020
@stale
Copy link

stale bot commented Sep 29, 2021

I mark this issue stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping the issue by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@stale stale bot added stale and removed stale labels Sep 29, 2021
@markus2330
Copy link
Contributor Author

@atmaxinger can you check if this is still open?

@atmaxinger
Copy link
Contributor

atmaxinger commented Aug 8, 2022

Okay so I tested this issue against the current master

The setup:

kdb mount `pwd`/i1164/spec.ni spec:/i1164 ni
kdb meta-set spec:/i1164/port type unsigned_short
kdb meta-set spec:/i1164/port check/type unsigned_short
kdb set user:/i1164/port 123

kdb meta-get user:/i1164/port check/type correctly returns unsigned_short
kdb meta-get /i1164/port check/type correctly returns unsigned_short

kdb set user:/i1164/port abc --> does not validate, sets the value as string
kdb set -N user /i1164/port abc --> invalid option -- 'N'

@markus2330
Copy link
Contributor Author

Thank you for reproducing! That -N doesn't work anymore is fine (it was redundant).

But kdb set user:/i1164/port abc should do validation, this is very problematic, as this is the main way how values should be changed.

I updated the top-post.

@kodebach
Copy link
Member

kodebach commented Aug 8, 2022

The setup: [...]

If that's the full setup, it cannot work. Neither the type plugin nor the any plugin for meta:/port are mounted. You either need an extra spec-mount or a more direct mount command with extra plugins.

EDIT: But looking at the code in src/tools/kdb/set.cpp, there is no attempt to assure a cascading parent key AFAICT, so adding the plugins probably won't change anything.

@atmaxinger
Copy link
Contributor

If that's the full setup, it cannot work. Neither the type plugin nor the any plugin for meta:/port are mounted. You either need an extra spec-mount or a more direct mount command with extra plugins.

Yes that's the full setup. TBH I thougt it would need some plugins, but I followed this guide and there was no mentioning of extra mounting the namespace with the plugins. If this is the case, the documentation should be revised to include this information.

@markus2330 markus2330 assigned hannes99 and unassigned atmaxinger Aug 8, 2022
@kodebach
Copy link
Member

kodebach commented Aug 8, 2022

Stopped before or you skipped the essential spec-mount step. This infers the required plugins from the meta:/ keys and creates appropriate mountpoints.

@atmaxinger
Copy link
Contributor

Yes I skipped it, as the description

This specification mount makes sure that the paths where the concrete configuration should be (app.ni) are ready to fulfill our specification (spec.ni).

sounded like it was only necessary when mounting the configuration from a file. As Elektra is also usable without mounting specific files (i.e. elektrified applications), I didn't think this was necessary.

@kodebach
Copy link
Member

kodebach commented Aug 8, 2022

It's not about whether or not you are using a file. It's about the existence of a mountpoint. If you don't call kdb mount (indirectly also happens via kdb spec-mount), your config will be saved in the default mountpoints (assuming no other more specific mountpoint exists from something else). But plugins only work, if they are explicitly added to a mountpoint. The default moutpoints only contain the bare minimum (storage and resolver plugins).

hannes99 added a commit that referenced this issue May 19, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 30, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 30, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 31, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 31, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue May 31, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 1, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 1, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 1, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 1, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 1, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 2, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 8, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 8, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 8, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 8, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 9, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 9, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 10, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 11, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 13, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jun 14, 2023
... and (partial) fix #3742, fix #4028, fix #1164
hannes99 added a commit that referenced this issue Jul 5, 2023
... and (partial) fix #3742, fix #4028, fix #1164
Copy link

I mark this stale as it did not have any activity for one year. I'll close it in two weeks if no further activity occurs. If you want it to be alive again, ping by writing a message here or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@github-actions github-actions bot added the stale label Feb 29, 2024
Copy link

I closed this now because it has been inactive for more than one year. If I closed it by mistake, please do not hesitate to reopen it or create a new issue with the remainder of this issue.
Thank you for your contributions 💖

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 14, 2024
@github-project-automation github-project-automation bot moved this to Done in 1.0 Aug 28, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants