Skip to content

Commit

Permalink
Merge pull request #39 from odra/INTLY-2026_pv-check-fix
Browse files Browse the repository at this point in the history
fix pv checks
  • Loading branch information
odra committed May 9, 2019
2 parents 3274958 + f90c1cf commit 82901a8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
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
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

0 comments on commit 82901a8

Please sign in to comment.