Skip to content

Commit

Permalink
fix of cluster list
Browse files Browse the repository at this point in the history
  • Loading branch information
Laure-di committed Mar 4, 2024
1 parent 585796d commit 33c8d47
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion internal/namespaces/redis/v1/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ func GetCommands() *core.Commands {
cmds := GetGeneratedCommands()

human.RegisterMarshalerFunc(redis.Cluster{}, redisClusterGetMarshalerFunc)
human.RegisterMarshalerFunc(redis.Cluster{}.Endpoints, redisEndpointsClusterGetMarshalerFunc)
human.RegisterMarshalerFunc(redis.Cluster{}, redisEndpointsClusterGetMarshalerFunc)

cmds.Merge(core.NewCommands(clusterWaitCommand()))
cmds.MustFind("redis", "cluster", "create").Override(clusterCreateBuilder)
Expand Down
7 changes: 2 additions & 5 deletions internal/namespaces/redis/v1/custom_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,8 @@ func ACLAddListBuilder(c *core.Command) *core.Command {
}

func redisEndpointsClusterGetMarshalerFunc(i interface{}, opt *human.MarshalOpt) (string, error) {
if opt == nil {
return "", nil
}
type tmp []*redis.Endpoint
endpoint := tmp(i.([]*redis.Endpoint))
type tmp redis.Cluster
endpoint := tmp(i.(redis.Cluster)).Endpoints
opt.Fields = []*human.MarshalFieldOpt{
{
FieldName: "ID",
Expand Down

0 comments on commit 33c8d47

Please sign in to comment.