Skip to content

Commit

Permalink
set acl in zk.set, zk.acquire_lock and zk.create functions
Browse files Browse the repository at this point in the history
  • Loading branch information
munakoiso committed Aug 27, 2024
1 parent 9a266ac commit b2d14ec
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/dcs/zk.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ func (z *zkDCS) AcquireLock(path string) bool {
if err != nil {
panic(fmt.Sprintf("failed to serialize to JSON %#v", self))
}
_, err = z.retryCreate(fullPath, data, zk.FlagEphemeral, nil)
_, err = z.retryCreate(fullPath, data, zk.FlagEphemeral, z.acl)
if err != nil {
if err != zk.ErrNodeExists {
z.logger.Errorf("failed to acquire lock %s: %v", fullPath, err)
Expand Down Expand Up @@ -377,7 +377,7 @@ func (z *zkDCS) create(path string, val interface{}, flags int32) error {
if err != nil {
panic(fmt.Sprintf("failed to serialize to JSON %#v", val))
}
_, err = z.retryCreate(fullPath, data, flags, nil)
_, err = z.retryCreate(fullPath, data, flags, z.acl)
if err != nil {
if err == zk.ErrNodeExists {
return ErrExists
Expand Down Expand Up @@ -412,7 +412,7 @@ func (z *zkDCS) set(path string, val interface{}, flags int32) error {
if err != nil {
return err
}
_, err = z.retryCreate(fullPath, data, flags, nil)
_, err = z.retryCreate(fullPath, data, flags, z.acl)
if err != nil {
z.logger.Errorf("failed to create node %s with %v: %v", fullPath, val, err)
}
Expand Down

0 comments on commit b2d14ec

Please sign in to comment.