mirror of
https://github.com/ceph/ceph-csi.git
synced 2025-06-14 18:53:35 +00:00
vendor updates
This commit is contained in:
8
vendor/k8s.io/kubernetes/cluster/restore-from-backup.sh
generated
vendored
8
vendor/k8s.io/kubernetes/cluster/restore-from-backup.sh
generated
vendored
@ -23,7 +23,7 @@
|
||||
# b) in case of etcd3
|
||||
# $ etcdctl --endpoints=<address> snapshot save
|
||||
# produced .db file
|
||||
# - version.txt file is in the current directy (if it isn't it will be
|
||||
# - version.txt file is in the current directory (if it isn't it will be
|
||||
# defaulted to "2.2.1/etcd2"). Based on this file, the script will
|
||||
# decide to which version we are restoring (procedures are different
|
||||
# for etcd2 and etcd3).
|
||||
@ -160,7 +160,7 @@ if [ "${ETCD_API}" == "etcd2" ]; then
|
||||
echo "Starting etcd ${ETCD_VERSION} to restore data"
|
||||
image=$(docker run -d -v ${BACKUP_DIR}:/var/etcd/data \
|
||||
--net=host -p ${etcd_port}:${etcd_port} \
|
||||
"gcr.io/google_containers/etcd:${ETCD_VERSION}" /bin/sh -c \
|
||||
"k8s.gcr.io/etcd:${ETCD_VERSION}" /bin/sh -c \
|
||||
"/usr/local/bin/etcd --data-dir /var/etcd/data --force-new-cluster")
|
||||
if [ "$?" -ne "0" ]; then
|
||||
echo "Docker container didn't started correctly"
|
||||
@ -191,7 +191,7 @@ elif [ "${ETCD_API}" == "etcd3" ]; then
|
||||
# Run etcdctl snapshot restore command and wait until it is finished.
|
||||
# setting with --name in the etcd manifest file and then it seems to work.
|
||||
docker run -v ${BACKUP_DIR}:/var/tmp/backup --env ETCDCTL_API=3 \
|
||||
"gcr.io/google_containers/etcd:${ETCD_VERSION}" /bin/sh -c \
|
||||
"k8s.gcr.io/etcd:${ETCD_VERSION}" /bin/sh -c \
|
||||
"/usr/local/bin/etcdctl snapshot restore ${BACKUP_DIR}/${snapshot} --name ${NAME} --initial-cluster ${INITIAL_CLUSTER} --initial-advertise-peer-urls ${INITIAL_ADVERTISE_PEER_URLS}; mv /${NAME}.etcd/member /var/tmp/backup/"
|
||||
if [ "$?" -ne "0" ]; then
|
||||
echo "Docker container didn't started correctly"
|
||||
@ -217,7 +217,7 @@ mkdir -p "${MNT_DISK}/var/etcd-corrupted"
|
||||
echo "Saving corrupted data to ${MNT_DISK}/var/etcd-corrupted"
|
||||
mv /var/etcd/data "${MNT_DISK}/var/etcd-corrupted"
|
||||
|
||||
# Replace the corrupted data dir with the resotred data.
|
||||
# Replace the corrupted data dir with the restored data.
|
||||
echo "Copying restored data to /var/etcd/data"
|
||||
mv "${BACKUP_DIR}" /var/etcd/data
|
||||
|
||||
|
Reference in New Issue
Block a user