Skip to content

Commit bda1345

Browse files
committed
Fix for time-stamper.sh as it was annotating all PVCs
1 parent 1c69150 commit bda1345

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

helm/blueapi/files/scripts/pvc-deletion.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/bin/sh
22
# Get all PVCs by running pods
33
ALL_PVCS=$(kubectl get pvc -n $RELEASE_NAMESPACE -o=jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | sort -u)
4+
BLUEAPI_PVCS=$( echo $ALL_PVCS | tr ' ' '\n' | grep blueapi-scratch)
45
NOW=$(date +%s)
56
#loop through all pvcs.
6-
for pvc in $ALL_PVCS; do
7+
for pvc in $BLUEAPI_PVCS; do
78
#check if pvc has last-used annotation
89
if kubectl get pvc $pvc -n $RELEASE_NAMESPACE -o=jsonpath='{.metadata.annotations.last-used}'
910
then

helm/blueapi/files/scripts/time-stamper.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
# Get all PVCs currently mounted by running pods
33
MOUNTED_PVCS=$(kubectl get pods -n $RELEASE_NAMESPACE \
44
-o=jsonpath='{.items[*].spec.volumes[*].persistentVolumeClaim.claimName}' | tr ' ' '\n' | sort -u)
5-
NOW=$(date +%s)
5+
BLUEAPI_PVCS=$( echo $MOUNTED_PVCS | tr ' ' '\n' | grep blueapi-scratch)
66
#loop through all the pvcs annotating ones thare are mounted
7-
for pvc in $MOUNTED_PVCS; do
7+
NOW=$(date +%s)
8+
for pvc in $BLUEAPI_PVCS; do
89
kubectl annotate --overwrite pvc "$pvc" -n $RELEASE_NAMESPACE last-used="$NOW"
910
done

0 commit comments

Comments
 (0)