Add a reset command to remove destination resources#293
Merged
michael-richey merged 9 commits intomainfrom Nov 15, 2024
Merged
Conversation
maycmlee
approved these changes
Oct 15, 2024
heyronhay
approved these changes
Nov 15, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Add a
resetcommand that deletes resources at a destinationDescription of the Change
The
resetcommand will attempt to backup the destination before deleting the resources. Both the backup and the delete respect any filtering and the resources flag.Possible Drawbacks
The drawback is inherent with the functionality. The user will have to ability to delete all resources in an org. This is mitigated in the following ways. First, the DDR check stops the script from running if the org is in a disaster state or if the org isn't a DDR org at all. The use has to manually override that check to stop it. Second, by default the reset command performs a backup.
Verification Process
Ran multiple resets of an org and was able to restore it from back up.
Additional Notes
Long term we may want to rethink the internal variable names with "source" and "destination" in them. In this specific case it gets confusing because we want to import and delete from the same datacenter, but sync-cli is very much built around the concept of moving data between a source and a destination. Renaming these might help with a future sync-cli where one or more sources are synced to one or more destinations. Imagine a large multi-org account wanting to sync dashboards from various child orgs to a single DDR R2 org.