Skip to content

fix: preserve Nacos metadata and clamp weights#4102

Open
spduan78 wants to merge 1 commit into
higress-group:mainfrom
spduan78:codex/fix-nacos-weight-metadata
Open

fix: preserve Nacos metadata and clamp weights#4102
spduan78 wants to merge 1 commit into
higress-group:mainfrom
spduan78:codex/fix-nacos-weight-metadata

Conversation

@spduan78

@spduan78 spduan78 commented Jul 7, 2026

Copy link
Copy Markdown

Summary

  • clamp rounded Nacos instance weights so healthy positive weights never become 0
  • apply the same weight normalization to Nacos v1 and v2 watchers
  • preserve v1 instance metadata labels when protocol is absent

Tests

  • GOCACHE=/private/tmp/higress-go-cache go test ./registry/nacos -run 'Test_generateServiceEntry_(Weight|WeightFieldSet)' -count=1
  • GOCACHE=/private/tmp/higress-go-cache go test ./registry/nacos/v2 -run 'Test_generateServiceEntry_(Weight|WeightFieldSet)' -count=1
  • GOCACHE=/private/tmp/higress-go-cache go test ./registry/nacos ./registry/nacos/v2

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

3 participants