Open dyx1234 opened 1 month ago
The changes introduce a configuration management feature that integrates Kubernetes ConfigMaps into the agollo package. This includes adding a handler for ConfigMaps, enhancing the loadBackupConfig
function to support loading configurations from ConfigMaps, and creating new files for managing and testing these functionalities. Additionally, the go.mod
file is updated with new dependencies for Kubernetes support and testing. Overall, the modifications enhance the flexibility and functionality of configuration management within the application.
Files | Change Summary |
---|---|
client.go , storage/repository.go , component/remote/async.go , env/config/config.go |
Introduced configuration management for Kubernetes ConfigMaps, including new methods and fields for handling backups and loading configurations. |
go.mod |
Updated with new dependencies for Kubernetes support and testing, and Go version upgraded to 1.22.0 . |
store/configMap/store.go , store/configmap/manager.go |
Added new structs and methods for managing ConfigMaps, including loading and writing configurations. |
store/configmap/manager_test.go , store/configmap/store_test.go |
Introduced unit tests for the new ConfigMap functionalities, ensuring correct operations with a fake Kubernetes client. |
sequenceDiagram
participant User
participant App
participant ConfigMapHandler
participant K8sManager
User->>App: Request Configuration
App->>ConfigMapHandler: Load ConfigMap
ConfigMapHandler->>K8sManager: Get ConfigMap
K8sManager-->>ConfigMapHandler: Return ConfigMap Data
ConfigMapHandler-->>App: Return Loaded Configuration
App-->>User: Provide Configuration
🐰 "In the garden of code, changes bloom bright,
With ConfigMaps dancing, a wonderful sight.
Kubernetes whispers, 'Manage with ease,'
As backups now flourish, like leaves in the breeze.
Hops of joy echo, for features anew,
In the patchwork of logic, our dreams now come true!" 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
感谢您提出Pull Request,我会尽快Review。我会在1-2日内进行查看或者回复,如果遇到节假日可能会处理较慢,敬请谅解。
What's the purpose of this PR
解决Apollo客户端在Kubernetes环境下因服务端宕机或Pod重启导致配置信息文件丢失的问题。通过使用Kubernetes ConfigMap作为新的持久化存储方案,提高配置信息的可靠性和容错性。
Solve the problem of Apollo client configuration information files being lost due to server downtime or Pod restart in the Kubernetes environment. By using Kubernetes ConfigMap as a new persistent storage solution, the reliability and fault tolerance of configuration information are improved.
discussion https://github.com/apolloconfig/apollo/discussions/5210
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores