Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

snh
Copy link
Member

@snh snh commented Mar 19, 2016

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

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"
Copy link
Contributor

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

@gnawhleinad
Copy link
Contributor

Could we add tests to test/test-ghe-restore.sh?

@snh
Copy link
Member Author

snh commented Mar 19, 2016

Could we add tests to test/test-ghe-restore.sh?

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.

@snh
Copy link
Member Author

snh commented Mar 19, 2016

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
Copy link
Member

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 :trollface:, but who wants to live forever.

@rubiojr
Copy link
Member

rubiojr commented Mar 20, 2016

🙇 👍

@snh
Copy link
Member Author

snh commented Mar 30, 2016

@rubiojr I just updated this branch so its up to date with master and updated a reference to sh to be to bash instead. Your welcome to merge this PR if you feel its ready for inclusion. 👍

@rubiojr rubiojr merged commit cc27045 into master Mar 30, 2016
@rubiojr rubiojr deleted the snh/cluster-restore-version-check branch March 30, 2016 09:04
cjonsmith pushed a commit that referenced this pull request Sep 22, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants