-
Notifications
You must be signed in to change notification settings - Fork 454
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
feature: add registry watcherStatus endpoint (#913) #915
Conversation
@CH3CHO 相关问题已修复,有时间麻烦再帮忙review下 |
纯代码层面的问题见行内注释。以下为功能层面的问题:
|
pkg/bootstrap/server.go
Outdated
watcherStatusList := registryReconciler.GetRegistryWatcherStatusList() | ||
writeJSON(w, watcherStatusList) | ||
|
||
w.WriteHeader(http.StatusOK) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果 writeJSON 执行出错了,下面再是写个 StatusOK 会不会有问题啊?
9abca3a
to
64b3bdc
Compare
关于上面的两个问题:
|
我这边验证了下,在Nacos 2.x且开启了认证的情况下会出现watcher创建失败的情况 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the API itself, LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@CH3CHO @hanxiantao 是否watchers中找不到对应信息,就认为not ready就可以? |
也可以的。 |
如果是这样的话,目前的代码可以合并的,新增一个failedRegistries来维护创建失败的,其实也有点多余,而且只在这个接口中使用到 |
Ⅰ. Describe what this PR did
controller中对外暴漏registry watcher的状态
Ⅱ. Does this pull request fix one issue?
fixes #913
Ⅲ. Why don't you add test cases (unit test/integration test)?
Ⅳ. Describe how to verify it
控制台中新增了两个Eureka的类型的服务来源
![image](https://private-user-images.githubusercontent.com/45159482/324167112-c843eb72-ef43-4752-b27a-4bfb4a9845e2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjQ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的healthyStatus为false,一直访问eureka server失败
请求controller的/registry/watcherStatus接口,效果如下:
Ⅴ. Special notes for reviews