File tree Expand file tree Collapse file tree
helm/blueapi/files/scripts Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/sh
22# Get all PVCs by running pods
33ALL_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)
45NOW=$( 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
Original file line number Diff line number Diff line change 22# Get all PVCs currently mounted by running pods
33MOUNTED_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 "
910done
You can’t perform that action at this time.
0 commit comments