Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit 6da8c79

Browse files
madalazaruniemimu
authored andcommitted
Backup K8s manifest file
Signed-off-by: Madalina Lazar <[email protected]>
1 parent 4ffb0d7 commit 6da8c79

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

telemetry-aware-scheduling/deploy/extender-configuration/configure-scheduler.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,18 @@ echo "Version of the image used in the kube scheduler is: $SCHEDULER_VERSION"
148148
get_kube_scheduler_api_version
149149
echo "Version of the KubeScheduler API: $KUBE_SCHEDULER_API_VERSION"
150150

151+
# backup manifest file before changing it
152+
echo "Backing up $MANIFEST_FILE..."
153+
BACKUP_DIR=$(mktemp -p "$scheduler_config_destination" -t backup-manifest-XXX -d)
154+
echo "Back-up dir is $BACKUP_DIR..."
155+
# exit it we can't back-up
156+
cp "$MANIFEST_FILE" "$BACKUP_DIR"
157+
if [ ! "$(ls -A "$BACKUP_DIR")" ]; then
158+
echo "Take action $BACKUP_DIR is empty. Copy command failed, exiting...."
159+
fi
160+
161+
echo "Back-up complete and available at $BACKUP_DIR."
162+
151163
####### CLEAN_UP MANIFEST FILE
152164
# In case the previous run of this script was partially successful or unsuccessful, we'd like to start from a clean
153165
# state, independent of any previous runs

0 commit comments

Comments
 (0)