feat: add node-name parameter support to HogConfig model #165
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.
Description
Earlier I implemented enhanced node selection capabilities in the krkn hogs scenario plugin, but for it to work properly I needed to fix a missing piece in krkn-lib.
The Issue:
The
HogConfig
class had anode_name
field declared (line 126) but thefrom_yaml_dict()
method wasn't parsing thenode-name
parameter from YAML configs. This forced me to use hacky dict access (scenario_dict.get('node-name')
) instead of clean model access in my plugin.My Fix:
Added the missing
node-name
parsing at line 182-183:Why This Matters:
This enables my enhanced hogs plugin to use proper
scenario_config.node_name
access instead of bypassing the type system. It unlocks the precise node targeting functionality I built:node-name: "worker-1"
for specific nodesWithout this fix, my enhanced functionality would be stuck with technical debt and unsafe dict access patterns.
complements
krkn-chaos/krkn#832
resolves
krkn-chaos/krkn#830
Documentation
If checked, a documentation PR must be created and merged in the website repository.
Related Documentation PR (if applicable)
Documentation will be handled in the main krkn plugin PR