Assume host is unavailable until inspection is done.#740
Assume host is unavailable until inspection is done.#740s3rj1k wants to merge 1 commit intometal3-io:masterfrom s3rj1k:master
Conversation
Signed-off-by: seivanov <seivanov@mirantis.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: s3rj1k 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 @s3rj1k. Thanks for your PR. I'm waiting for a metal3-io 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/test-infra repository. |
|
/assign @maelk |
|
I'm not sure this is the right place to be making the decision. We probably shouldn't have that Available() method at all, since it should be up to the user of the API to decide which hosts it thinks are usable. The host has a status field now that it didn't have before, so we could change CAPM3 to look at that, like we do in CAPBM. |
|
@dhellmann Currently there is also a similar check in https://github.com/metal3-io/baremetal-operator/blob/master/apis/metal3.io/v1alpha1/baremetalhost_types.go#L744 Removing Can we do this check in BM-operator? |
|
How about calling NeedsHardwareInspection() method from within Avaliable() method? |
What I'm proposing is that we properly separate the concerns. The Available() method is from a time when I had not thought through the implications of having the host type control when provisioning could be requested. That's not really its job, though. We should deprecate Available() and change metal3machine_manager.go to perform all of the checks it wants. Then, if we decide CAPM3 should not provision a host until after inspection we can apply that rule there without forcing it on other consumers. It's not clear, though, why we consider the availability of a host related to whether inspection has been performed. The baremetal-operator will just wait to provision the host if the image settings are applied before inspection. |
|
See metal3-io/cluster-api-provider-metal3#150 and #741 instead. |
|
The idea to have one single method to check in CAPM3 (or possible forks) versus multiple of aggregated methods. It seems that providing a single method to check availability is more convenient. |
Well, you're adding a rule that I don't think we want in CAPBM, so it's not actually convenient. :-) |
|
@dhellmann Please do not close this PR before a merge of |
|
The provisioning state is a far superior way of determining whether a host can be provisioned than the hardware details. |
|
@zaneb Still feels bad that there is no promise of stable API |
The API is the CRD, and that's not changing, right? |
API on a level of k8s indeed does not change, but on a golang level (when some one imports code) it does change. |
In the golang ecosystem not even actual libraries offer stable APIs, let alone internal implementations that were never designed to be used as libraries. |
Well this is a matter of declaring this officially, do any of Also they do say to vendor, this is ok when they do frequent tag releases. |
|
I think we should create a separate issue about tag releases and vendoring. What do you all think? |
|
I have no problem with tagging more releases. But yes, let's discuss that elsewhere. |
Signed-off-by: seivanov seivanov@mirantis.com