Skip to content

Conversation

@starbops
Copy link
Member

@starbops starbops commented Jan 23, 2026

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:

  1. Create a ClusterNetwork
  2. Create a VlanConfig for the ClusterNetwork
  3. Check the LinkMonitor

@starbops starbops requested a review from a team January 30, 2026 04:27
@starbops starbops marked this pull request as ready for review January 30, 2026 04:27
Copilot AI review requested due to automatic review settings January 30, 2026 04:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 LinkUnknown constant with value "unknown" to the LinkState type
  • 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.

@rrajendran17
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants