Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
ncode committed Nov 27, 2023
1 parent 3b3f092 commit d993bc9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions pkg/aclmanager/aclmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ func (a *AclManager) SyncAcls() (err error) {
})
defer master.Close()

_, err := syncAcls(master, a.RedisClient)
_, err := mirrorAcls(master, a.RedisClient)
if err != nil {
return fmt.Errorf("error syncing acls: %v", err)
}
Expand Down Expand Up @@ -152,8 +152,8 @@ func listAcls(client *redis.Client) (acls []string, err error) {
return acls, err
}

// syncAcls returns a list of acls in the cluster based on the redis acl list command
func syncAcls(source *redis.Client, destination *redis.Client) (deleted []string, err error) {
// mirrorAcls returns a list of acls in the cluster based on the redis acl list command
func mirrorAcls(source *redis.Client, destination *redis.Client) (deleted []string, err error) {
sourceAcls, err := listAcls(source)
if err != nil {
return nil, fmt.Errorf("error listing source acls: %v", err)
Expand Down
8 changes: 4 additions & 4 deletions pkg/aclmanager/aclmanager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ func TestListAcls(t *testing.T) {
}
}

func TestSyncAcls(t *testing.T) {
func TestMirrorAcls(t *testing.T) {
tests := []struct {
name string
sourceAcls []interface{}
Expand Down Expand Up @@ -223,12 +223,12 @@ func TestSyncAcls(t *testing.T) {
}
}

deleted, err := syncAcls(sourceClient, destinationClient)
deleted, err := mirrorAcls(sourceClient, destinationClient)
if (err != nil) != tt.wantErr {
t.Errorf("syncAcls() error = %v, wantErr %v", err, tt.wantErr)
t.Errorf("mirrorAcls() error = %v, wantErr %v", err, tt.wantErr)
}
if !reflect.DeepEqual(deleted, tt.expectedDeleted) {
t.Errorf("syncAcls() deleted = %v, expectedDeleted %v", deleted, tt.expectedDeleted)
t.Errorf("mirrorAcls() deleted = %v, expectedDeleted %v", deleted, tt.expectedDeleted)
}
})
}
Expand Down

0 comments on commit d993bc9

Please sign in to comment.