Skip to content

Commit

Permalink
fix corner case for backup/restore RBAC object with trailing slash, w…
Browse files Browse the repository at this point in the history
…arn /clickhouse/access//uuid have no children, skip Dump
  • Loading branch information
Slach committed Aug 14, 2024
1 parent 862b736 commit 8a9ff37
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ func (k *Keeper) GetReplicatedAccessPath(userDirectory string) (string, error) {
if zookeeperPathNode == nil {
return "", fmt.Errorf("can't find %s in %s", xPathQuery, k.xmlConfigFile)
}
return strings.TrimSuffix(zookeeperPathNode.InnerText(), "/"), nil
zookeeperPath := zookeeperPathNode.InnerText()
if zookeeperPath != "/" {
zookeeperPath = strings.TrimSuffix(zookeeperPathNode.InnerText(), "/")
}
return zookeeperPath, nil
}

func (k *Keeper) Dump(prefix, dumpFile string) (int, error) {
Expand Down

0 comments on commit 8a9ff37

Please sign in to comment.