Skip to content

Commit c487d5a

Browse files
authored
Merge pull request #447 from github/lildude/remove-old-versions
Remove 2.11 and earlier specific code and tests
2 parents 946b17b + 2aa0451 commit c487d5a

File tree

2 files changed

+0
-67
lines changed

2 files changed

+0
-67
lines changed

bin/ghe-restore

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,6 @@ if ghe-ssh "$GHE_HOSTNAME" -- \
137137
exit 1
138138
fi
139139

140-
# Only allow restores of 2.9 and 2.10 snapshots that have run the audit log migration to 2.11 and above
141-
if ! $force; then
142-
snapshot_instance_version=$(cat $GHE_RESTORE_SNAPSHOT_PATH/version)
143-
snapshot_version_major=$(echo "${snapshot_instance_version#v}" | cut -f 1 -d .)
144-
snapshot_version_minor=$(echo "$snapshot_instance_version" | cut -f 2 -d .)
145-
if ! test -f $GHE_RESTORE_SNAPSHOT_PATH/es-scan-complete && \
146-
[ "$snapshot_version_major" -eq 2 ] && [ "$snapshot_version_minor" -lt 11 ] && \
147-
[ "$GHE_VERSION_MAJOR" -eq 2 ] && [ "$GHE_VERSION_MINOR" -ge 11 ]; then
148-
echo "Error: Snapshot must be from GitHub Enterprise v2.9 or v2.10 after running the" >&2
149-
echo " audit log migration, or from v2.11.0 or above." >&2
150-
echo "Please see https://git.io/v5rCE for the audit log migration procedure." >&2
151-
exit 1
152-
fi
153-
fi
154-
155140
# Prompt to verify the restore host given is correct. Restoring overwrites
156141
# important data on the destination appliance that cannot be recovered. This is
157142
# mostly to prevent accidents where the backup host is given to restore instead

test/test-ghe-restore.sh

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -336,58 +336,6 @@ begin_test "ghe-restore honours --help and -h flags"
336336
)
337337
end_test
338338

339-
begin_test "ghe-restore fails when restore 2.9/2.10 snapshot without audit log migration sentinel file to 2.11"
340-
(
341-
set -e
342-
343-
# noop if not testing against 2.11
344-
if [ "$(version $GHE_REMOTE_VERSION)" -ne "$(version 2.11.0)" ]; then
345-
skip_test
346-
fi
347-
348-
rm -rf "$GHE_REMOTE_ROOT_DIR"
349-
setup_remote_metadata
350-
351-
echo "rsync" > "$GHE_DATA_DIR/current/strategy"
352-
echo "v2.9.10" > "$GHE_DATA_DIR/current/version"
353-
rm "$GHE_DATA_DIR/current/es-scan-complete"
354-
355-
! output=$(ghe-restore -v localhost 2>&1)
356-
357-
echo $output | grep -q "Error: Snapshot must be from GitHub Enterprise v2.9 or v2.10 after running the"
358-
359-
echo "v2.10.5" > "$GHE_DATA_DIR/current/version"
360-
! output=$(ghe-restore -v localhost 2>&1)
361-
362-
echo $output | grep -q "Error: Snapshot must be from GitHub Enterprise v2.9 or v2.10 after running the"
363-
)
364-
end_test
365-
366-
begin_test "ghe-restore force restore of 2.9/2.10 snapshot without audit log migration sentinel file to 2.11"
367-
(
368-
set -e
369-
370-
# noop if not testing against 2.11
371-
if [ "$(version $GHE_REMOTE_VERSION)" -ne "$(version 2.11.0)" ]; then
372-
skip_test
373-
fi
374-
375-
rm -rf "$GHE_REMOTE_ROOT_DIR"
376-
setup_remote_metadata
377-
378-
echo "rsync" > "$GHE_DATA_DIR/current/strategy"
379-
echo "v2.9.10" > "$GHE_DATA_DIR/current/version"
380-
381-
# Create fake remote repositories dir
382-
mkdir -p "$GHE_REMOTE_DATA_USER_DIR/repositories"
383-
384-
ghe-restore -v -f localhost
385-
386-
echo "v2.10.5" > "$GHE_DATA_DIR/current/version"
387-
ghe-restore -v -f localhost
388-
)
389-
end_test
390-
391339
begin_test "ghe-restore exits early on unsupported version"
392340
(
393341
set -e

0 commit comments

Comments
 (0)