Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(configtree): prefix keys with '/' when importing to etcd #336

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

pallabpain
Copy link
Member

@pallabpain pallabpain commented Jul 15, 2024

Description

This pull request addresses a request made by @tetorea that the keys imported in etcd via the CLI do not have a leading / and that the applications relying on the feature expect the / in the keys that they are reading.

To solve the issue, we are adding a / when a prefix is not specified when importing the keys into etcd.

Testing

→ etcdctl get --prefix --keys-only /
/master/apis/gwm_auth_token

/master/apis/gwm_core_url

Copy link

🤖 Pull Request Artifacts (#9936496977) 🎉

@pallabpain pallabpain force-pushed the fix/configtree-etcd-export branch from d382bdc to 0f30dc7 Compare July 15, 2024 09:48
Comment on lines +36 to +39
prefix = prefix or ''

for key, val in data.items():
if prefix:
key = '{}/{}'.format(prefix, key)
key = '{}/{}'.format(prefix, key)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

python3
Python 3.10.12 (main, Mar 22 2024, 16:50:05) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> prefix = None
>>> prefix = prefix or ''
>>> print(prefix)

>>> key = 'master/path/to/key'
>>> key = '{}/{}'.format(prefix, key)
>>> print(key)
/master/path/to/key
>>> 

Copy link

🤖 Pull Request Artifacts (#9937251040) 🎉

@pallabpain pallabpain self-assigned this Jul 15, 2024
@pallabpain pallabpain added the 🐛 bug Something isn't working label Jul 15, 2024
@pallabpain pallabpain marked this pull request as ready for review July 15, 2024 11:14
@pallabpain pallabpain requested review from a team as code owners July 15, 2024 11:14
@pallabpain pallabpain requested review from amitsingh21, RomilShah and ankitrgadiya and removed request for RomilShah July 15, 2024 11:14
@pallabpain pallabpain merged commit 9c74fb5 into devel Jul 26, 2024
6 checks passed
rr-github-ci-user pushed a commit that referenced this pull request Aug 2, 2024
# [8.0.0](v7.6.0...v8.0.0) (2024-08-02)

### Bug Fixes

* **apply:** print file name when there is a parsing error ([413ce94](413ce94))
* **auth:** do not save password in cli config ([08a399c](08a399c))
* **bootstrap:** handle exceptions thrown by the cli ([d703df3](d703df3))
* **configtree:** prefix keys with '/' when importing to etcd ([#336](#336)) ([9c74fb5](9c74fb5))
* **configtree:** update sentinel key when tree is imported in etcd ([#337](#337)) ([8ea304b](8ea304b))
* **deployment:** show errors in deployments list ([66f2c7f](66f2c7f))
* **device:** filter uploaded files by name in name_to_request_id ([7348be2](7348be2))
* **jsonschema:** add platform as a product for virtual devices ([#338](#338)) ([6eb50f0](6eb50f0))
* **organization:** fix organization select command ([#339](#339)) ([7943a4a](7943a4a))
* **package:** update the imageTag regex to support semver tags ([#335](#335)) ([6e17408](6e17408))
* **v2client:** set organizationguid header by default ([#330](#330)) ([eaa1185](eaa1185))

### Features

* adds command to list explain examples ([3fc228e](3fc228e))
* **template:** sort rendered templates by file-name ([161ddfc](161ddfc))

### BREAKING CHANGES

* **auth:** The password is no longer saved in the riocli
config.json file.

Wrike Ticket: https://www.wrike.com/open.htm?id=1162009098
@rr-github-ci-user
Copy link
Collaborator

🎉 This PR is included in version 8.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@pallabpain pallabpain deleted the fix/configtree-etcd-export branch October 14, 2024 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants