[libvirt_manager] Add parent_group key for libvirt layouts#3925
[libvirt_manager] Add parent_group key for libvirt layouts#3925michburk wants to merge 1 commit into
Conversation
|
Skipping CI for Draft Pull Request. |
nemarjan
left a comment
There was a problem hiding this comment.
LGTM in general, just some questions.
| {{ | ||
| _cifmw_libvirt_manager_layout.vms | | ||
| dict2items | | ||
| selectattr('value.parent_group', 'defined') | |
There was a problem hiding this comment.
(non-blocking): Since selectattr('value.parent_group', 'defined') only checks key existence, would an explicitly empty value like parent_group: "" slip through here? If so, it would produce a file named -group.yml and a nameless group?
There was a problem hiding this comment.
That'd be an interesting situation, I'll test it and probably end up adding an explicit check for an empty string and fail in that case. Thanks!
There was a problem hiding this comment.
Tested a setup with parent_group: '' and this did indeed create a -group.yml file, added an explicit check: rejectattr('value.parent_group', 'equalto', '') to not create this file. Other parts of this patch treat an empty value as falsey and don't do anything if '' is supplied as a parent group, so rejecting here treats it as if there were no parent group field at all.
If you think parent_group: '' should produce an error early on instead, I wouldn't mind refactoring to handle it that way.
9fbc705 to
35a87eb
Compare
35a87eb to
62f4064
Compare
|
Also added a check to the My testing used two child VM types (compute94 and compute96) both setting parent_group: computes, with no Nemanja's comment prompted me to test a layout with both a regular |
d202b36 to
8a9d4a5
Compare
8a9d4a5 to
3ff2f09
Compare
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 46m 24s |
|
recheck |
3ff2f09 to
ec67224
Compare
|
Build failed (check pipeline). Post ❌ openstack-k8s-operators-content-provider FAILURE in 6m 31s |
ec67224 to
5c83861
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
5c83861 to
4cf077d
Compare
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 16m 14s |
|
recheck |
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 23m 56s |
2fd84a3 to
5f501ee
Compare
|
recheck |
7c13c92 to
372a52f
Compare
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 29m 30s |
372a52f to
ce3761e
Compare
|
Build failed (check pipeline). Post ✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 50m 05s |
Allow VM types to declare a parent_group so that multiple subgroups (e.g. compute1, compute2) are independently addressable while also being reachable via a shared parent inventory group (e.g. computes). Generated-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Michael Burke <michburk@redhat.com>
ce3761e to
e547f7d
Compare
Allow VM types to declare a parent_group key. Hosts are added to the parent group at add_host time so that groups like 'computes' are populated before dependent roles check group membership. A parent group inventory file is also written to reproducer-inventory/ for subsequent playbook runs.