Skip to content

fix(ironic): stop chassis_model hook from wiping other traits - #2260

Open
cardoe wants to merge 1 commit into
mainfrom
fix-chassis-model-trait-clobber
Open

fix(ironic): stop chassis_model hook from wiping other traits#2260
cardoe wants to merge 1 commit into
mainfrom
fix-chassis-model-trait-clobber

Conversation

@cardoe

@cardoe cardoe commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

set_node_traits kept only existing traits not starting with prefix
"CUSTOM
", then re-added the chassis trait via TraitList.create, which
replaces the whole list. Since every Ironic custom trait starts with
CUSTOM_, this dropped all other traits (CUSTOM_SWITCH,
CUSTOM_FIRMWARE_UPDATE
, etc.) on every inspection.

Move the chassis trait into a reserved CUSTOM_CHASSIS_ namespace
(CUSTOM_CHASSIS_{MANUFACTURER}{MODEL}) so the hook can scope itself:
it adds the required trait and prunes only other CUSTOM_CHASSIS
traits,
leaving all other traits untouched. This mirrors the update-baremetal-port
hook, which owns the CUSTOM_*_SWITCH namespace.

Update the inspection guide and add unit tests for the hook.

_set_node_traits kept only existing traits not starting with prefix
"CUSTOM_", then re-added the chassis trait via TraitList.create, which
replaces the whole list. Since every Ironic custom trait starts with
CUSTOM_, this dropped all other traits (CUSTOM_*_SWITCH,
CUSTOM_FIRMWARE_UPDATE_*, etc.) on every inspection.

Move the chassis trait into a reserved CUSTOM_CHASSIS_ namespace
(CUSTOM_CHASSIS_{MANUFACTURER}_{MODEL}) so the hook can scope itself:
it adds the required trait and prunes only other CUSTOM_CHASSIS_ traits,
leaving all other traits untouched. This mirrors the update-baremetal-port
hook, which owns the CUSTOM_*_SWITCH namespace.

Update the inspection guide and add unit tests for the hook.
@cardoe
cardoe requested a review from a team August 28, 2026 21:50
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.

1 participant