diff --git a/internal/namespaces/redis/v1/custom.go b/internal/namespaces/redis/v1/custom.go index 64f09798ec..dbea5e3913 100644 --- a/internal/namespaces/redis/v1/custom.go +++ b/internal/namespaces/redis/v1/custom.go @@ -10,6 +10,7 @@ func GetCommands() *core.Commands { cmds.Merge(core.NewCommands(clusterWaitCommand())) cmds.MustFind("redis", "cluster", "create").Override(clusterCreateBuilder) cmds.MustFind("redis", "cluster", "delete").Override(clusterDeleteBuilder) + cmds.MustFind("redis", "acl", "add").Override(ACLAddListBuilder) return cmds } diff --git a/internal/namespaces/redis/v1/custom_cluster.go b/internal/namespaces/redis/v1/custom_cluster.go index c12dea6740..53093dfcd3 100644 --- a/internal/namespaces/redis/v1/custom_cluster.go +++ b/internal/namespaces/redis/v1/custom_cluster.go @@ -144,3 +144,15 @@ func clusterWaitCommand() *core.Command { }, } } + +func ACLAddListBuilder(c *core.Command) *core.Command { + c.AddInterceptors(func(ctx context.Context, argsI interface{}, runner core.CommandRunner) (interface{}, error) { + originalResp, err := runner(ctx, argsI) + if err != nil { + return nil, err + } + ACLAddResponse := originalResp.(*redis.AddACLRulesResponse) + return ACLAddResponse.ACLRules, nil + }) + return c +}