⚠️ Improve priority and validation of input variables consumed in wait_for_interface_or_ip#788
⚠️ Improve priority and validation of input variables consumed in wait_for_interface_or_ip#788mchiappero wants to merge 2 commits intometal3-io:mainfrom
Conversation
|
[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 |
|
Hi @mchiappero. Thanks for your PR. I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
85381e6 to
4b626bc
Compare
|
/ok-to-test |
|
Also, isn't this the same as #787 ? |
The PRs are stacked, as far as I can see it's not possible to set a different branch, but I should have mentioned that in the description. Let me fix it... along with the proposed changes (thanks for reviewing!). |
Sure. But before squashing I'd like to make sure the change is fully understood, though. By the way, IRONIC_IP is not documented in https://github.com/metal3-io/ironic-image/blob/main/README.md, while it probably should. Also, which variables take precedence is also not documented either, nor logged by the scripts. I guess maybe something to discuss at the weekly meeting. Let me know what you think! |
4b626bc to
b26391c
Compare
|
/hold |
b26391c to
a3971ce
Compare
|
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
|
/remove-lifecycle stale |
How Ironic and related services are configured and bound to the system interfaces fundamentally depends on three possible inputs: - a provisioning IP (if PROVISIONING_IP is set), which, if found, is used to determine IRONIC_IP - a provisioning interface (if PROVISIONING_INTERFACE or PROVISIONING_MACS is set), by setting IRONIC_IP to the first IP address found on such interface - IRONIC_IP directly, whenever set Depending on the variable(s) set, the function might search and possibly wait for the requested interface or IP to appear. Rework the test logic of the function, so that the three possible cases are clearly listed and tested separately, by introducing an explicit check for IRONIC_IP. This allows to: - validate the value of IRONIC_IP, when externally provided - test PROVISIONING_INTERFACE separately, in order to improve readability - validate at least one of the above three inputs is provided and fail gracefully otherwise Note that 1) the order of the evaluation is not changed 2) for this to work, no default value should be set in PROVISIONING_INTERFACE prior to the execution of wait_for_interface_or_ip; thus remove "provisioning" from get_provisioning_interface. NOTE: a test for PROVISIONING_MACS could also be moved to wait_for_interface_or_ip and get_provisioning_interface removed, but this commits aims at minimizing change. Signed-off-by: Marco Chiappero <marco.chiappero@suse.com>
Currently wait_for_interface_or_ip determined how to bind the services onto the system by evaluating the input variables in the following order: PROVISIONING_IP, IRONIC_IP, PROVISIONING_INTERFACE. However IRONIC_IP should likely be considered as overriding any PROVISIONING_* value. Thus, make sure IRONIC_IP is evaluated at the beginning of the chain. Signed-off-by: Marco Chiappero <marco.chiappero@suse.com>
d61deb8 to
32b7266
Compare
|
/retest |
|
/test metal3-centos-e2e-integration-test-main metal3-ubuntu-e2e-integration-test-main |
/retest |
|
/test metal3-centos-e2e-integration-test-main |
|
Sorry, I didn't have much time to look into it, and I'm not sure I understand why it's failing; but it looks like it's some Ansible task: What do you think? |
|
/unhold |
|
/retest let's give it another try |
|
@mchiappero: The following test failed, say
DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
@mchiappero: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
That could have direct relation to change being made. |
My bot says: Ie. it fails on ubuntu which has local (ie. non-k8s) Ironic, while passing on centos (k8s ironic). |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
This was superseded by above linked PR. /close |
|
@tuminoid: Closed this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
Let's reopen, PR #935 addresses a different problem. If I understand it correctly the only problem is the final else, I wasn't aware of the possibility of running ironic without any of those variables defined. What should the logic be in such case? |
Yes true, we still have prioritization etc left here. My bad.
We either or maybe even both:
WDYT @elfosardo ? |
|
@tuminoid: Reopened this PR. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
@tuminoid that should work |
|
Sorry for the late reply, I had to take some time off this week. Before applying any change, I would like to double check:
I think it would be good to document this logic, from a developer perspective, but also from the user point of view. Maybe I can add some edits to README.md in this PR if we have a decision on the outcome. |
This cannot be valid indeed, otherwise no IRONIC_IP & URLs are generated. I'm not sure I understand why it is not passing the tests. |
It is not valid, but it is just not defined anywhere with local Ironic case. To fix that, the suggestion made earlier stands.
As for the question 2 about IRONIC_IP priority, I need to defer to @elfosardo or @Rozzii . |
What this PR does / why we need it:
The current logic in wait_for_interface_or_ip deals with the input IP addresses or interfaces, according to the following order: PROVISIONING_IP, IRONIC_IP, PROVISIONING_INTERFACE. The improvements this PR introduces are:
What the PR does not address is logging a warning in case of multiple input variables set and one taking inevitably precedence over the another(s).
NOTE: based on PR #787
Checklist: