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

lxc: Support parsing of anonymous nested structs for getting properties #12073

Merged
merged 2 commits into from
Jul 24, 2023

Conversation

gabrielmougard
Copy link
Contributor

@gabrielmougard gabrielmougard commented Jul 24, 2023

closes #12071

Now this will work

lxc config set c1/snap0 expires_at="2023-08-01T00:00:00Z" --property
lxc config show c1/snap0 | grep expires_at
expires_at: 2023-08-01T00:00:00Z
lxc config get c1/snap0 architecture --property
x86_64
lxc config get c1/snap0 expires_at --property
2023-08-01T00:00:00Z

Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
@tomponline
Copy link
Member

@gabrielmougard what was the issue in the end?

@gabrielmougard
Copy link
Contributor Author

The getFieldByJSONTag was simply not recursive on the nested structs. So in the example of InstanceSnapshot, the expires_at field is embedded within InstanceSnapshotPut yaml:",inline"`` which was not parsed previously.

@tomponline
Copy link
Member

Thanks. Please can you update the tests with accessing/setting an instance snapshot expiry date?

@tomponline tomponline changed the title lxc/utils: Support parsing of anonymous nested structs lxc: Support parsing of anonymous nested structs for getting properties Jul 24, 2023
Signed-off-by: Gabriel Mougard <gabriel.mougard@canonical.com>
@tomponline tomponline merged commit ae9eb94 into canonical:main Jul 24, 2023
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.

lxc config get on an instance snapshot property doesn't work
2 participants