fix: link unknown should not be categorized as down#232
fix: link unknown should not be categorized as down#232starbops wants to merge 2 commits intoharvester:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes an issue where network links with an unknown operational state were incorrectly being categorized as "down". The change introduces a new LinkUnknown state to properly represent links that are not explicitly up or down.
Changes:
- Added a new
LinkUnknownconstant with value "unknown" to theLinkStatetype - Refactored the link state determination logic from if-else to a switch statement that properly handles all netlink operational states
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| pkg/apis/network.harvesterhci.io/v1beta1/linkmonitor.go | Adds new LinkUnknown constant to support unknown link states |
| pkg/controller/agent/linkmonitor/controller.go | Updates linkToLinkStatus function to use switch statement and map unknown OperState values to LinkUnknown instead of LinkDown |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: Zespre Chang <[email protected]>
Signed-off-by: Zespre Chang <[email protected]>
|
Thanks for the changes.Can you also generate a new linkmonitor crd with updated enum "unknown" in manifests/crds/network.harvesterhci.io_linkmonitors.yaml from the api and also update https://github.com/harvester/charts/blob/master/charts/harvester-network-controller/templates/crds/network.harvesterhci.io_linkmonitors.yaml |
Problem:
Links that are not up will be considered as down.
Solution:
Links that are in the unknown state should be reflected genuinely in the LinkMonitor CR.
Related Issue:
harvester/harvester#9140
Test plan: