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

lxd: Update logic for project config patch #13786

Merged
merged 2 commits into from
Jul 22, 2024

Conversation

boltmark
Copy link
Contributor

This PR provides an update to the logic for patching project configurations. Previously, there was an overwrite of the existing project config such that it was updated to consist solely of the data in the patch. With this update we maintain existing key/value pairs, and only overwrite those also present in the patch.

Closes #13632.

@boltmark boltmark requested a review from tomponline July 18, 2024 20:15
lxd/api_project.go Outdated Show resolved Hide resolved
@tomponline
Copy link
Member

@boltmark Please can you add a test for updating projects via PATCH, see test_certificate_edit function in the tests dir for an example of patch tests.

my_curl -X PATCH -d "{\"certificate\":\"$(sed ':a;N;$!ba;s/\n/\\n/g' "${LXD_CONF}/client-new.crt")\"}" "https://${LXD_ADDR}/1.0/certificates/${FINGERPRINT}"

You can add it to the projects.sh file in the test_projects_crud function.

@boltmark
Copy link
Contributor Author

@tomponline Thanks for the comments. I have added testing for updating project configs via PATCH in projects.sh under test_projects_crud. I have also removed the error logging as per the above comment. This is ready for another review!

Copy link
Member

@tomponline tomponline left a comment

Choose a reason for hiding this comment

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

Thanks!

@tomponline tomponline merged commit 6bd75c9 into canonical:main Jul 22, 2024
28 of 29 checks passed
ru-fu added a commit to ru-fu/lxd that referenced this pull request Jul 22, 2024
The functionality was fixed in canonical#13786

Signed-off-by: Ruth Fuchss <[email protected]>
tomponline added a commit that referenced this pull request Jul 22, 2024
tomponline pushed a commit to tomponline/lxd that referenced this pull request Jul 23, 2024
The functionality was fixed in canonical#13786

Signed-off-by: Ruth Fuchss <[email protected]>
hamistao pushed a commit to hamistao/lxd that referenced this pull request Jul 23, 2024
The functionality was fixed in canonical#13786

Signed-off-by: Ruth Fuchss <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PATCH /1.0/projects/<project> removes existing configuration
2 participants