fix(host_network): retrieve proper hostname and next available bond id #182
No reviewers
Labels
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: NationTech/harmony#182
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "network-manager"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
In order to query the current network state
NodeNetworkStateand to apply aNodeNetworkConfigurationPolicyfor a given node, we first needed to find its hostname. As all we had was the UUID of a node.We had different options available (e.g. updating the Harmony Inventory Agent to retrieve it, store it in the OKD installation pipeline on assignation, etc.). But for the sake of simplicity and for better flexibility (e.g. being able to run this score on a cluster that wasn't setup with Harmony), the
hostnamewas retrieved directly in the cluster by running the equivalent ofkubectl get nodes -o yamland matching the nodes with the system UUID.Other changes
Note: to see a quick demo, watch the recording in https://git.nationtech.io/NationTech/harmony/pulls/183
LGTM, just make sure the bond checking logic is correct.
@ -271,0 +329,4 @@.and_then(|network_state| network_state.status.current_state.as_ref()).map_or(&interfaces, |current_state| ¤t_state.interfaces).iter().filter(|i| i.r#type == nmstate::InterfaceType::Bond && i.link_aggregation.is_some())Why
type Bond AND link_aggregation?I would have thought type bond is enough here? The AND could cause us using an existing bond that has no aggregation (yet)?
good point, I'll remove the second part of the check
@ -568,0 +614,4 @@&self,list_params: Option<ListParams>,) -> Result<ObjectList<Node>, Error> {self.list_resources(None, list_params).awaitRust is so beautiful. Type K infered from return type, completely transparent, super powerful, super readable, super intuitive.