-
Notifications
You must be signed in to change notification settings - Fork 624
Minimum version enforcement for cluster restores #182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
bin/ghe-restore
Outdated
snapshot_instance_version=$(cat $GHE_RESTORE_SNAPSHOT_PATH/version) | ||
if ! echo $snapshot_instance_version | \ | ||
grep -Eq "v2\.[5-9]|v2\.[1-9][0-9]|v[3-9]|v[1-9][0-9]"; then | ||
echo "Error: Snapshot must be from GitHub Enterprise v2.5.0 and above to be restored" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v2.5.0 or above
Could we add tests to |
I originally commented that we don't have tests for clusters in backup-utils, which wasn't entirely accurate. We don't have tests in this repo because these tests currently need a real cluster infrastructure to run against. That's not possible to setup for this repo, so we run those tests internally. I will look at adding a test for this PR to the existing internal tests. |
Add clustering tests
Thanks to @gnawhleinad, this PR now includes tests. These tests run without requiring access to a real cluster infrastructure, so are able to be included in this repo. ✨ |
if $cluster; then | ||
snapshot_instance_version=$(cat $GHE_RESTORE_SNAPSHOT_PATH/version) | ||
if ! echo $snapshot_instance_version | \ | ||
grep -Eq "v2\.[5-9]|v2\.[1-9][0-9]|v[3-9]|v[1-9][0-9]"; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminded me that we need to add a semver comparison helper at some point, somewhere. The ^^^ regex may not be future proof , but who wants to live forever.
🙇 👍 |
@rubiojr I just updated this branch so its up to date with master and updated a reference to |
Update shellcheck download url
Require that snapshots originated from an instance running GitHub Enterprise 2.5.0 or above when restoring to a cluster.
Fixes #181
/cc @github/backup-utils @cjs @rubiojr @electroniko