-
Notifications
You must be signed in to change notification settings - Fork 254
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add LLDPProcessed information from ironic-inspector data #1167
Conversation
Hi @shibaPuppy. 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. 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/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
I've left some comments, but I think it's a significant enough API addition to justify a spec in metal3-docs first.
@@ -599,6 +630,9 @@ type NIC struct { | |||
|
|||
// Whether the NIC is PXE Bootable | |||
PXE bool `json:"pxe,omitempty"` | |||
|
|||
// Save ironic inspection data to lldp | |||
LLDPProcessed LLDPProcessed `json:"lldp,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "Processes" part is essentially an internal detail, let's leave just LLDP.
@@ -564,6 +564,37 @@ type Storage struct { | |||
// +kubebuilder:validation:Maximum=4094 | |||
type VLANID int32 | |||
|
|||
type LLDPProcessed struct { | |||
// https://github.com/openstack/python-ironic-inspector-client/blob/master/ironic_inspector_client/resource.py#L24-L59 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This becomes a comment from the Interface field, which is wrong. Ideally, we need a meaningful comment for each item, but definitely not a link to the code.
Interface string `json:"interface,omitempty"` | ||
Mac string `json:"mac,omitempty"` | ||
NodeIdent string `json:"node_ident,omitempty"` | ||
SwitchCapabilitiesEnabled []string `json:"switch_capabilities_enabled,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should create a Switch substructure just to make the API a bit more usable.
SwitchCapabilitiesSupport []string `json:"switch_capabilities_support,omitempty"` | ||
SwitchChassisId string `json:"switch_chassis_id,omitempty"` | ||
SwitchMgmtAddresses []string `json:"switch_mgmt_addresses,omitempty"` | ||
SwitchPortAutonegotiation_enabled string `json:"switch_port_autonegotiation_enabled,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not mix cases.
SwitchPortMTU int `json:"switch_port_mtu,omitempty"` | ||
SwitchPortPhysicalCapabilities string `json:"switch_port_physical_capabilities,omitempty"` | ||
SwitchPortProtocolVlanEnabled string `json:"switch_port_protocol_vlan_enabled,omitempty"` | ||
SwitchPortProtocolVlanIds string `json:"switch_port_protocol_vlan_ids,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's weird to have VlanIds as string
in one place and as []string
(why not int?) in another. I don't remember why it was done initially, but I suggest we clean it up.
@@ -24,6 +28,21 @@ func GetHardwareDetails(data *introspection.Data) *metal3v1alpha1.HardwareDetail | |||
return details | |||
} | |||
|
|||
func getLLDPProcessed(intf introspection.BaseInterfaceType) metal3v1alpha1.LLDPProcessed { | |||
lldpjson, err := json.Marshal(intf.LLDPProcessed) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope there is a more efficient way to get the structure than to serialize it and deserialize back...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dtantsur
i can't think of a good way.
do you have any code to suggest?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of dump the entiry data, how about saving only specific values first?
74ea25f
to
da44645
Compare
/retest |
Please label the PR appropriately based on https://github.com/metal3-io/baremetal-operator/blob/main/CONTRIBUTING.md#contributing-a-patch to make it easier to sort it out while releasing in the changelog, thanks! |
On a second thought... maybe add a new CR for LLDP information and link to it? My worry is that this change will make hardware data absolutely unreadable in case when LLDP data is actually present. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
/remove-lifecycle stale |
PR needs rebase. 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/test-infra repository. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with /lifecycle stale |
@Rozzii @dtantsur @furkatgofurov7 If no one does it, I'll try to start next month. |
Hello, |
Stale issues close after 30d of inactivity. Reopen the issue with /close |
@metal3-io-bot: Closed this PR. In 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/test-infra repository. |
@shibaPuppy Should we let this PR get closed? I assume you are working on the new CR, so this is not relevant anymore. |
@Rozzii @dtantsur @furkatgofurov7 would it be better to create a CR in the form of "NetworkDiscoveryData" referenced in "HardwareDetail" and add it? ex)
|
I see there is still interest in this so I will reopen. |
[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.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@shibaPuppy: The following tests failed, say
Full PR test history. Your PR dashboard. 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/test-infra repository. I understand the commands that are listed here. |
This PR has passed is a bit out of date now let's organize this discussion a bit better. |
Collect node LLDP information.
ex) if there is no LLDP information