Skip to content

Commit

Permalink
Add cleanup for redis-sentinel
Browse files Browse the repository at this point in the history
  • Loading branch information
warrenchristian1telus committed Oct 18, 2024
1 parent 84a251b commit 6f96ba9
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,23 +111,28 @@ jobs:
oc delete configmap/${{ inputs.CRON_NAME }}-config
fi
- name: 🧹️ Clean ${{ inputs.REDIS_NAME }}-redis-cluster
- name: 🧹️ Clean ${{ inputs.REDIS_NAME }}
run: |
if [[ `oc describe sts ${{ inputs.REDIS_NAME }} 2>&1` =~ "NotFound" ]]; then
if [[ `oc describe sts ${{ inputs.REDIS_NAME }}-node 2>&1` =~ "NotFound" ]]; then
echo "${{ inputs.REDIS_NAME }} NOT FOUND: Skipping..."
else
echo "${{ inputs.REDIS_NAME }} FOUND: Cleaning..."
oc delete sts/${{ inputs.REDIS_NAME }}
echo "${{ inputs.REDIS_NAME }}-node FOUND: Cleaning..."
oc delete sts/${{ inputs.REDIS_NAME }}-node
fi
if [[ `oc describe configmap ${{ inputs.REDIS_NAME }}-configuration 2>&1` =~ "NotFound" ]]; then
echo "${{ inputs.REDIS_NAME }}-configuration NOT FOUND: Skipping..."
else
oc delete configmap ${{ inputs.REDIS_NAME }}-configuration
fi
if [[ `oc describe configmap ${{ inputs.REDIS_NAME }}-redis-cluster-default 2>&1` =~ "NotFound" ]]; then
echo "${{ inputs.REDIS_NAME }}-redis-cluster-default NOT FOUND: Skipping..."
if [[ `oc describe configmap ${{ inputs.REDIS_NAME }}-scripts 2>&1` =~ "NotFound" ]]; then
echo "${{ inputs.REDIS_NAME }}-scripts NOT FOUND: Skipping..."
else
oc delete configmap ${{ inputs.REDIS_NAME }}-redis-cluster-default
oc delete configmap ${{ inputs.REDIS_NAME }}-scripts
fi
if [[ `oc describe configmap ${{ inputs.REDIS_NAME }}-redis-cluster-scripts 2>&1` =~ "NotFound" ]]; then
echo "${{ inputs.REDIS_NAME }}-redis-cluster-scripts NOT FOUND: Skipping..."
if [[ `oc describe configmap ${{ inputs.REDIS_NAME }}-health 2>&1` =~ "NotFound" ]]; then
echo "${{ inputs.REDIS_NAME }}-health NOT FOUND: Skipping..."
else
oc delete configmap ${{ inputs.REDIS_NAME }}-redis-cluster-scripts
oc delete configmap ${{ inputs.REDIS_NAME }}-health
fi
- name: Clean Database PVCs
Expand Down

0 comments on commit 6f96ba9

Please sign in to comment.