Create POD struct with restore destination info (#947)
## Description
This PR has just the struct definition to allow conversation about the design if needed. Future PR(s) will create and populate the struct during restore (in the CLI-layer since this struct is meant to be used to communicate that information) and pass it down the stack to the graph connector
The roadmap has plans for allowing users to
1. change the "root" folder the restore occurs in
1. change the resource owner of the restored items (e.x. restoring items from one user to a different user)
Both options can be enabled at the same time (e.x. restore "Inbox" from user A to "UserAInboxRestore" in user B). When the folder is not given it should default to "Corso_Restore_\<date time\>" and when the resource owner is not given the item should be restored under the original resource owner. As of now, we don't expect to have to have fine-grained control over restoring multiple users to different folders on a per-user basis. However, we may need to restore to specify a folder that is created for multiple users and restored to.
Examples:
**Not expected:** Restore UserA Inbox to folder1 in their hierarchy and UserB to folder2 in their hierarchy
**Expected:** Restore UserA Inbox to Corso_Restore_2022-09-23
POD struct:
```go
dest := selectors.RestoreDestination{
ContainerName: "Corso_Restore_2022-09-23",
}
```
**Expected:** Restore UserA Inbox to UserB Corso_Restore_2022-09-23
POD struct:
```go
dest := selectors.RestoreDestination{
ResourceOwnerOverride: "UserB",
ContainerName: "Corso_Restore_2022-09-23",
}
```
**Maybe expected:** For UserA and UserB, restore Inbox to folder1 in their separate hierarchies
```go
dest := selectors.RestoreDestination{
ContainerName: "Corso_Restore_2022-09-23",
}
```
Given the limited nature of the destination requirement, a POD struct seems like the best option for the foreseeable future. If we need more complex functionality down the line we can expand from this
## Type of change
<!--- Please check the type of change your PR introduces: --->
- [ ] 🌻 Feature
- [ ] 🐛 Bugfix
- [ ] 🗺️ Documentation
- [ ] 🤖 Test
- [ ] 💻 CI/Deployment
- [x] 🐹 Trivial/Minor
## Issue(s)
<!-- Can reference multiple issues. Use one of the following "magic words" - "closes, fixes" to auto-close the Github issue. -->
* #897
## Test Plan
<!-- How will this be tested prior to merging.-->
- [ ] 💪 Manual
- [ ] ⚡ Unit test
- [ ] 💚 E2E
This commit is contained in:
parent
38addfaae8
commit
7b5c8d43f1
@ -24,3 +24,16 @@ func Defaults() Options {
|
||||
FailFast: true,
|
||||
}
|
||||
}
|
||||
|
||||
// RestoreDestination is a POD that contains an override of the resource owner
|
||||
// to restore data under and the name of the root of the restored container
|
||||
// hierarchy.
|
||||
type RestoreDestination struct {
|
||||
// ResourceOwnerOverride overrides the default resource owner to restore to.
|
||||
// If it is not populated items should be restored under the previous resource
|
||||
// owner of the item.
|
||||
ResourceOwnerOverride string
|
||||
// ContainerName is the name of the root of the restored container hierarchy.
|
||||
// This field must be populated for a restore.
|
||||
ContainerName string
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user