Skip to content
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

webhook/mutator: filter out the witness node #104

Merged

Conversation

Vicente-Cheng
Copy link
Contributor

Problem:
The matched-node returns the whole nodes even if we have one witness node.
The witness node did not run any workload, so we should filter out this.

Solution:
we do not allow any workload on the witness node, so we should filter out the witness node when creating the vlan config.

Related Issue:
harvester/harvester#5325 (comment)

Test plan:
Make sure the annotation of vlanconfig response should looks like below (harvester-node-1 is the witness node)

annotations: {network.harvesterhci.io/matched-nodes: "["harvester-node-0","harvester-node-2"]"}

    - we do not allow any workload on the witness node, so we should
      filter out the witness node when creating the vlan config

Signed-off-by: Vicente Cheng <[email protected]>
@Vicente-Cheng
Copy link
Contributor Author

cc @a110605, backend PR is here.

Copy link
Member

@starbops starbops left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

Copy link
Contributor

@mingshuoqiu mingshuoqiu left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks

@Vicente-Cheng Vicente-Cheng merged commit 1813db8 into harvester:master Aug 2, 2024
3 checks passed
@a110605
Copy link

a110605 commented Aug 5, 2024

Hi @Vicente-Cheng , I test with the latest harvester-network-controller. The config filter out witness when first created, but wait for 3 ~ 5 mins the witness node is auto added in matched-nodes annotation.

Do we have any mechanism to auto update annotation from backend ?

Reproduce Steps:

  1. create network config via select all nodes
  2. check the config YAML, the witness node is not in matched-nodes annotation
  3. Wait for 3 ~ 5 mins and refresh the page.
  4. The witness node is added in annotation

1
2

@Vicente-Cheng
Copy link
Contributor Author

@Mergifyio backport v0.4.x

Copy link

mergify bot commented Aug 7, 2024

backport v0.4.x

✅ Backports have been created

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.

4 participants