Skip to content
This repository was archived by the owner on Feb 16, 2023. It is now read-only.

Commit e449eb2

Browse files
committed
Skip path if the person in org does not have any permissions
1 parent 5060d8f commit e449eb2

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

internals/secrethub/migrate.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func (cmd *MigratePlanCommand) addDirToPlan(client secrethub.ClientInterface, pa
257257

258258
tree, err := client.Dirs().GetTree(path, -1, false)
259259
if err == api.ErrForbidden {
260-
fmt.Fprintf(os.Stderr, "WARN: Skipping %s because you do not have read access. ", path)
260+
fmt.Fprintf(os.Stderr, "WARN: Skipping '%s' because you do not have read access. ", path)
261261
accessLevels, err := client.AccessRules().ListLevels(path)
262262
if err == nil {
263263
var usernames []string
@@ -273,7 +273,8 @@ func (cmd *MigratePlanCommand) addDirToPlan(client secrethub.ClientInterface, pa
273273
return nil
274274
}
275275
if err != nil {
276-
return err
276+
fmt.Fprintf(os.Stderr, "WARN: Skipping '%s' because it is either not valid or you do not have read access. Ask an admin to migrate the skipped secrets if the path is valid.\n", path)
277+
return nil
277278
}
278279

279280
err = addTreeToPlan(tree, plan)

0 commit comments

Comments
 (0)