Skip to content
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

Delays deletion of the Solr directory until after download in NameLookup #910

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions helm/name-lookup/templates/scripts-config-map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,22 @@ data:
#!/bin/sh
set -xa
DATA_DIR="/var/solr/data"
DOWNLOAD_DIR="/var/solr/download"
BACKUP_NAME="snapshot.backup"
BACKUP_ZIP="${BACKUP_NAME}.tar.gz"
BACKUP_URL="{{ .Values.dataUrl }}"
rm -rf $DATA_DIR/*
wget -nv -O $DATA_DIR/$BACKUP_ZIP $BACKUP_URL

# Delete the download directory.
rm -rf $DOWNLOAD_DIR
mkdir -p $DOWNLOAD_DIR
wget -nv -O $DOWNLOAD_DIR/$BACKUP_ZIP $BACKUP_URL

# Download
rm -rf $DATA_DIR
mkdir -p $DATA_DIR
cd $DATA_DIR
tar -xf $DATA_DIR/$BACKUP_ZIP -C $DATA_DIR
rm $DATA_DIR/$BACKUP_ZIP
tar -xf $DOWNLOAD_DIR/$BACKUP_ZIP -C $DATA_DIR
rm -rf $DOWNLOAD_DIR
restore.sh: |-
#!/bin/sh

Expand Down
2 changes: 1 addition & 1 deletion helm/name-lookup/templates/solr-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ spec:
command:
- /download.sh
volumeMounts:
- mountPath: /var/solr/data
- mountPath: /var/solr
name: {{ include "name-lookup.fullname" . }}-solr-data-vol
- mountPath: "/download.sh"
name: {{ include "name-lookup.fullname" . }}-configmap
Expand Down