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

fix pv checks #39

Merged
merged 1 commit into from
May 9, 2019
Merged
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
25 changes: 13 additions & 12 deletions image/tools/lib/component/codeready_pv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,18 @@ function dump_pod_data {
}

function component_dump_data {
workspace_pods=$(oc get pods -n ${PRODUCT_NAMESPACE_PREFIX}codeready | grep workspace | awk '{print $1}')

if [ "${#workspace_pods}" -eq "0" ]; then
echo "No workspaces found to backup"
else
archive_path="$1/archives"
dump_dest="/tmp/codeready-data"
mkdir -p $dump_dest
for i in $workspace_pods; do dump_pod_data $i $dump_dest; done
local ts=$(date '+%H_%M_%S')
tar -zcvf "$archive_path/codeready-pv-data-${ts}.tar.gz" -C $dump_dest .
rm -rf $dump_dest
local pods="$(oc get pods -n ${PRODUCT_NAMESPACE_PREFIX}codeready | grep workspace)"
if [ "${#pods}" -eq "0" ]; then
echo "=>> No workspaces found to backup"
exit 0
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldnt find a better way to handle this in the entrypoint file so I decided to exit here

fi

local workspace_pods="$(echo $pods | awk '{print $1}')"
local archive_path="$1/archives"
local dump_dest="/tmp/codeready-data"
mkdir -p $dump_dest
for i in $workspace_pods; do dump_pod_data $i $dump_dest; done
local ts=$(date '+%H_%M_%S')
tar -zcvf "$archive_path/codeready-pv-data-${ts}.tar.gz" -C $dump_dest .
rm -rf $dump_dest
}
5 changes: 5 additions & 0 deletions image/tools/lib/component/enmasse_pv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ function component_dump_data {
local dump_dest="/tmp/enmasse-data"
local pods=$(get_broker_pods)

if [ "${#pods}" -eq "0" ]; then
echo "=>> No broker pods found to backup"
exit 0
fi

mkdir -p ${dump_dest}

for pod in ${pods}; do
Expand Down