fix clues addall and withall
This commit is contained in:
parent
c5b5a60d4e
commit
c62c246ee2
@ -118,7 +118,7 @@ func RestoreCollections(
|
|||||||
permissionIDMappings = map[string]string{}
|
permissionIDMappings = map[string]string{}
|
||||||
)
|
)
|
||||||
|
|
||||||
ctx = clues.AddAll(
|
ctx = clues.Add(
|
||||||
ctx,
|
ctx,
|
||||||
"backup_version", backupVersion,
|
"backup_version", backupVersion,
|
||||||
"destination", dest.ContainerName)
|
"destination", dest.ContainerName)
|
||||||
@ -142,7 +142,7 @@ func RestoreCollections(
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
err error
|
err error
|
||||||
ictx = clues.AddAll(
|
ictx = clues.Add(
|
||||||
ctx,
|
ctx,
|
||||||
"resource_owner", dc.FullPath().ResourceOwner(), // TODO: pii
|
"resource_owner", dc.FullPath().ResourceOwner(), // TODO: pii
|
||||||
"category", dc.FullPath().Category(),
|
"category", dc.FullPath().Category(),
|
||||||
@ -228,7 +228,7 @@ func RestoreCollection(
|
|||||||
restoreFolderElements := []string{restoreContainerName}
|
restoreFolderElements := []string{restoreContainerName}
|
||||||
restoreFolderElements = append(restoreFolderElements, drivePath.Folders...)
|
restoreFolderElements = append(restoreFolderElements, drivePath.Folders...)
|
||||||
|
|
||||||
ctx = clues.AddAll(
|
ctx = clues.Add(
|
||||||
ctx,
|
ctx,
|
||||||
"destination_elements", restoreFolderElements,
|
"destination_elements", restoreFolderElements,
|
||||||
"drive_id", drivePath.DriveID)
|
"drive_id", drivePath.DriveID)
|
||||||
@ -450,11 +450,11 @@ func CreateRestoreFolders(
|
|||||||
) (string, error) {
|
) (string, error) {
|
||||||
driveRoot, err := service.Client().DrivesById(driveID).Root().Get(ctx, nil)
|
driveRoot, err := service.Client().DrivesById(driveID).Root().Get(ctx, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", clues.Wrap(err, "getting drive root").WithClues(ctx).WithAll(graph.ErrData(err)...)
|
return "", clues.Wrap(err, "getting drive root").WithClues(ctx).With(graph.ErrData(err)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
parentFolderID := ptr.Val(driveRoot.GetId())
|
parentFolderID := ptr.Val(driveRoot.GetId())
|
||||||
ctx = clues.AddAll(ctx, "drive_root_id", parentFolderID)
|
ctx = clues.Add(ctx, "drive_root_id", parentFolderID)
|
||||||
|
|
||||||
logger.Ctx(ctx).Debug("found drive root")
|
logger.Ctx(ctx).Debug("found drive root")
|
||||||
|
|
||||||
@ -526,7 +526,7 @@ func restoreData(
|
|||||||
// Upload the stream data
|
// Upload the stream data
|
||||||
written, err := io.CopyBuffer(w, progReader, copyBuffer)
|
written, err := io.CopyBuffer(w, progReader, copyBuffer)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", details.ItemInfo{}, clues.Wrap(err, "writing item bytes").WithClues(ctx).WithAll(graph.ErrData(err)...)
|
return "", details.ItemInfo{}, clues.Wrap(err, "writing item bytes").WithClues(ctx).With(graph.ErrData(err)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
dii := details.ItemInfo{}
|
dii := details.ItemInfo{}
|
||||||
@ -626,7 +626,7 @@ func restorePermissions(
|
|||||||
PermissionsById(permissionIDMappings[p.ID]).
|
PermissionsById(permissionIDMappings[p.ID]).
|
||||||
Delete(ctx, nil)
|
Delete(ctx, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return permissionIDMappings, clues.Wrap(err, "removing permissions").WithClues(ctx).WithAll(graph.ErrData(err)...)
|
return permissionIDMappings, clues.Wrap(err, "removing permissions").WithClues(ctx).With(graph.ErrData(err)...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -651,7 +651,7 @@ func restorePermissions(
|
|||||||
|
|
||||||
np, err := service.Client().DrivesById(driveID).ItemsById(itemID).Invite().Post(ctx, pbody, nil)
|
np, err := service.Client().DrivesById(driveID).ItemsById(itemID).Invite().Post(ctx, pbody, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return permissionIDMappings, clues.Wrap(err, "setting permissions").WithClues(ctx).WithAll(graph.ErrData(err)...)
|
return permissionIDMappings, clues.Wrap(err, "setting permissions").WithClues(ctx).With(graph.ErrData(err)...)
|
||||||
}
|
}
|
||||||
|
|
||||||
permissionIDMappings[p.ID] = *np.GetValue()[0].GetId()
|
permissionIDMappings[p.ID] = *np.GetValue()[0].GetId()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user