From 9c0f694d937eba5e53c099f36714db91f82c4192 Mon Sep 17 00:00:00 2001 From: munakoiso Date: Tue, 27 Aug 2024 20:17:24 +0500 Subject: [PATCH] set acl in zk.set, zk.acquire_lock and zk.create functions (#125) --- internal/dcs/zk.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/dcs/zk.go b/internal/dcs/zk.go index c56e8ccd..dad96014 100644 --- a/internal/dcs/zk.go +++ b/internal/dcs/zk.go @@ -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) @@ -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 @@ -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) }