Uh oh!
There was an error while loading. Please reload this page.
fix(ironic): stop chassis_model hook from wiping other traits - #2260
Open
cardoe wants to merge 1 commit into
Open
fix(ironic): stop chassis_model hook from wiping other traits#2260cardoe wants to merge 1 commit into
cardoe wants to merge 1 commit into
Conversation
_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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.