Skip to content

Commit

Permalink
Only return full path not sub path
Browse files Browse the repository at this point in the history
Instead of returning
```
secret/environment/dev/petshop
secret/environment/dev
secret/environment
```

it return's only the full path.
```
secret/environment/dev/petshop
```
  • Loading branch information
fr123k committed Apr 22, 2021
1 parent c2ec641 commit c8a2b51
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions client/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,21 +48,20 @@ func (client *Client) listLowLevel(path string, mode int) (result []string, err
}

func (client *Client) listAllLowLevel(path string, subResult* []string) (result[]string, err error) {
// fmt.Printf("lookup root %s\n", path)
subResult2, err := client.listLowLevel(path, MODE_IGNORE_NONE_DIRECTORY)
if subResult2 != nil {
var subResult3 []string
for _, resultPath := range subResult2 {
// fmt.Printf("lookup loop %s\n", path +resultPath)
_, err := client.listAllLowLevel(normalizedVaultPath(path + resultPath), subResult)
if err != nil {
log.AppTrace("%+v", err)
return subResult3, err
}
result = append(result, normalizedVaultPath(path + resultPath))
}
} else {
*subResult = append(*subResult, path)
}
*subResult = append(*subResult, result...)
return *subResult, err
}

Expand Down

0 comments on commit c8a2b51

Please sign in to comment.