-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add extension mechanism for CRDMetadata registry | 新增扩展机制,支持注册自定义的 CRDMetadata #15
Comments
请问这个扩展机制期望实现的效果是怎么样的呢? |
@ShawnHXH 当 OpenSergo Control Plane 接收到 OpenSergoClient 发起 subscribe 自定义 CRD 资源的请求时,OpenSergo Control Plane 对 K8s 中的 资源 addWatch 时,能够找到 对应自定义CRDMetadata,即 在 AddWatch 方法内部调用的 GetCrdMetadata` 方法能够找到对应的 自定义 CRDMetadata。 AddWatch 方法内部内部调用 GetCrdMetadata` 代码位于:
opensergo-control-plane/pkg/controller/crd_meta.go Lines 75 to 79 in 91ef7e9
crdMetadataMap 缓存位于: opensergo-control-plane/pkg/controller/crd_meta.go Lines 56 to 73 in 91ef7e9
因此,最终效果就是,将 OpenSergo 自身不支持的、用户自定义的 CRDMetadata 注册 至 PS: 自定义的 CRDMetadata 的缓存 设计时可以与 |
@ShawnHXH Are you interested in contributing it ? 😃 |
Sure, please assign it to me. |
Hi, 我阐述一下初步的实现思路,若有不妥请指正。
opensergo-control-plane/pkg/controller/k8s_operator.go Lines 120 to 139 in 91ef7e9
也就是说在 考虑到上述 handler 是在 opensergo-control-plane/control_plane.go Lines 37 to 45 in 91ef7e9
opensergo-control-plane/pkg/transport/grpc/server.go Lines 143 to 149 in 91ef7e9
所以可以在
这样的话,基本需求即可实现。 但是,我还有一个问题: opensergo-control-plane/pkg/controller/crd_meta.go Lines 25 to 29 in 91ef7e9
|
cc @sczyh30 PTAL |
Add extension mechanism for CRDMetadata registry, so that we could register CRDMetadata outside the control plane pkg.
Related code: https://github.com/opensergo/opensergo-control-plane/blob/91ef7e92e2745c646f294f248c5c4249ef488af2/pkg/controller/crd_meta.go
新增扩展机制,支持注册自定义的 CRDMetadata,以便其他 control plane 能够更方便地扩展使用 OpenSergo 控制面模块。
The text was updated successfully, but these errors were encountered: