Conversation
e7af2b7 to
e1f3b20
Compare
e1f3b20 to
dd8a80a
Compare
|
to test this validation change |
dd8a80a to
f71516a
Compare
Strategy: Minimal patch to Ironic's app.py that imports middleware.
The patch adds 6 lines before `return app` in setup_app() - if upstream
changes break this, the build fails immediately rather than silently.
All validation logic (`{node_name}-port-channel{number} where number is between 100-998`) lives in ironic-understack package,
making it easy to update without touching the patch.
f71516a to
279c334
Compare
cardoe
left a comment
There was a problem hiding this comment.
Since this is a direct Ironic patch, please read the information on how to backport this patch into our stable branch in the README.md in the container directory. Please make me a Jira to update the documentation to make this clearer and I will work on that when I return.
cardoe
left a comment
There was a problem hiding this comment.
Oh never mind. I see what you did by enabling more middleware's. That's actually an interesting idea. This might be good to propose an interface upstream on how to do this without needing to directly patch ironic. Make a Jira for this anyway and we can discuss it when I return. You're also welcome to create an ironic bug at https://bugs.launchpad.net and ask for a way to load additional middleware's. Link this PR and that'll start the discussion upstream and we can pick it up further when I return. But doing that bug report would be the first step and very helpful.
cardoe
left a comment
There was a problem hiding this comment.
I'm +1 on this. But with the improvements I suggested as a follow on. You can add an entry point into pyproject.toml for this module as well.
| + from ironic_understack.portgroup_name_middleware import ( | ||
| + PortgroupNameValidationMiddleware, | ||
| + ) | ||
| + app = PortgroupNameValidationMiddleware(app) |
There was a problem hiding this comment.
So we can look into installing a hook into a path like ironic.api.middleware like other interfaces like hooks. Then we use steveadore to load them by name. This would make this dynamic and extensible.
|
If you open that bug report please link it here as a comment. |
Portgroup Name Validation
Adds middleware to enforce portgroup naming convention required by undersync. Names must match
{node_name}-port-channel{number}where number is between 100-998.Validation Examples
Rejected - number out of range (20 < 100):
Rejected - missing number:
Rejected - wrong suffix format:
Rejected - non-numeric suffix:
Rejected - number out of range (2234 > 998):
Accepted - valid name: