Skip to content

fix: ClusterSlaves result should be cut#884

Merged
drivebyer merged 1 commit intoOT-CONTAINER-KIT:masterfrom
drivebyer:fix-get-slaves-id
Apr 20, 2024
Merged

fix: ClusterSlaves result should be cut#884
drivebyer merged 1 commit intoOT-CONTAINER-KIT:masterfrom
drivebyer:fix-get-slaves-id

Conversation

@drivebyer
Copy link
Copy Markdown
Collaborator

Description
ClusterSlaves get slave info, we should parse it to get slave node id.
截屏2024-04-20 14 49 45

otherwise, the error log:

{"level":"error","ts":"2024-04-20T14:50:06+08:00","logger":"controllers.RedisCluster","msg":"Could not execute command","Command":["redis-cli","--cluster","del-node","redis-cluster-v1beta2-leader-0.redis-cluster-v1beta2-leader-headless.default.svc:6379","3acb029fead40752f432c84f9bed2e639119a573 192.168.84.239:6379@16379,redis-cluster-v1beta2-follower-5 slave e3299968586dd457a8dba04fc6c747cecd38510f 0 1713595736542 6 connected"],"Output":">>> Removing node 3acb029fead40752f432c84f9bed2e639119a573 192.168.84.239:6379@16379,redis-cluster-v1beta2-follower-5 slave e3299968586dd457a8dba04fc6c747cecd38510f 0 1713595736542 6 connected from cluster redis-cluster-v1beta2-leader-0.redis-cluster-v1beta2-leader-headless.default.svc:6379\n[ERR] No such node ID 3acb029fead40752f432c84f9bed2e639119a573 192.168.84.239:6379@16379,redis-cluster-v1beta2-follower-5 slave e3299968586dd457a8dba04fc6c747cecd38510f 0 1713595736542 6 connected\n","error":"execute command with error: command terminated with exit code 1, stderr: ","stacktrace":"github.com/OT-CONTAINER-KIT/redis-operator/k8sutils.executeCommand\n\t/Users/wuyang/workspace/github.com/drivebyer/redis-operator-1/k8sutils/redis.go:402\ngithub.com/OT-CONTAINER-KIT/redis-operator/k8sutils.RemoveRedisFollowerNodesFromCluster\n\t/Users/wuyang/workspace/github.com/drivebyer/redis-operator-1/k8sutils/cluster-scaling.go:312\ngithub.com/OT-CONTAINER-KIT/redis-operator/controllers.(*RedisClusterReconciler).Reconcile\n\t/Users/wuyang/workspace/github.com/drivebyer/redis-operator-1/controllers/rediscluster_controller.go:95\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/Users/wuyang/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:119\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/Users/wuyang/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:316\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/Users/wuyang/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/Users/wuyang/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:227"}

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • Tests have been added/modified and all tests pass.
  • Functionality/bugs have been confirmed to be unchanged or fixed.
  • I have performed a self-review of my own code.

Additional Context

Signed-off-by: drivebyer <yang.wu@daocloud.io>
@drivebyer drivebyer added the bug Something isn't working label Apr 20, 2024
@drivebyer drivebyer requested a review from shubham-cmyk April 20, 2024 07:40
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 39.51%. Comparing base (d121d86) to head (5b1c3f7).
Report is 28 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #884      +/-   ##
==========================================
+ Coverage   35.20%   39.51%   +4.31%     
==========================================
  Files          19       19              
  Lines        3213     2660     -553     
==========================================
- Hits         1131     1051      -80     
+ Misses       2015     1540     -475     
- Partials       67       69       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@drivebyer drivebyer enabled auto-merge (squash) April 20, 2024 08:34
@drivebyer drivebyer merged commit 7999a05 into OT-CONTAINER-KIT:master Apr 20, 2024
@drivebyer drivebyer deleted the fix-get-slaves-id branch April 26, 2024 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants