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

feat: http实例查询接口支持多个metadata条件查询 #1353

Merged
merged 3 commits into from
May 23, 2024

Conversation

WTIFS
Copy link
Contributor

@WTIFS WTIFS commented May 20, 2024

Please provide issue(s) of this PR:
Fixes #

/naming/v1/instances 接口目前只支持查询一组 metadata 条件,我们希望支持可查询多组 metadata 条件,为此进行了如下修改:

  1. 修改 ParseQueryParams 函数,当 query 里的 keysvalues 有多个时,使用逗号将其拼接
  2. 修改 preGetInstances 函数,使用逗号解析 keysvalues 字段,并将其写入 map

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • ApiServer
  • Auth
  • Configuration
  • Naming
  • HealthCheck
  • Metrics
  • Docs
  • Installation
  • Performance and Scalability
  • Test and Release

Please check any characteristics that apply to this pull request.

  • Does not have any user-facing changes. This may include API changes, behavior changes, performance improvements, etc.

@polaris-test-bot
Copy link

polaris-test-bot commented May 20, 2024

2024-05-20 16:16:23: =========TEST START==========
2024-05-23 15:06:28: =========TEST START==========
2024-05-23 15:08:36: =========TEST START==========

@chuntaojun
Copy link
Member

添加一个单元测试下?

@WTIFS
Copy link
Contributor Author

WTIFS commented May 23, 2024

添加一个单元测试下?

已添加,看看 ok 嘛

@chuntaojun
Copy link
Member

是不是可以在扩展下,比如这些 metadata 是需要 and 才满足,还是 or 匹配模式;以及是否支持反查询,即查询没有这些标签的实例?

@WTIFS
Copy link
Contributor Author

WTIFS commented May 23, 2024

是不是可以在扩展下,比如这些 metadata 是需要 and 才满足,还是 or 匹配模式;以及是否支持反查询,即查询没有这些标签的实例?

那要改的地方恐怕有点多,metaFilter 现在是一个非常简单的 map[string]string 结构,这个结构目前只能按 and 模式来查询

@chuntaojun chuntaojun merged commit 5330d65 into polarismesh:main May 23, 2024
6 of 9 checks passed
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.

None yet

3 participants