scheduled-cloud-cleaner: remove storage account skip
scheduled cloud cleaner is skipping the default storage account for a resource group, as this images should get removed. There can be a situation where this images are not removed and forgotten here. Remove this skip condition so scc checks also in this storage account.
This commit is contained in:
parent
a6e2755fad
commit
031b67566b
1 changed files with 1 additions and 5 deletions
|
|
@ -69,12 +69,8 @@ STORAGE_ACCOUNT_COUNT=$(echo "$STORAGE_ACCOUNT_LIST" | jq .[].name | wc -l)
|
||||||
DELETE_TIME=$(date -d "- $HOURS_BACK hours" +%s)
|
DELETE_TIME=$(date -d "- $HOURS_BACK hours" +%s)
|
||||||
for i in $(seq 0 $(("$STORAGE_ACCOUNT_COUNT"-1))); do
|
for i in $(seq 0 $(("$STORAGE_ACCOUNT_COUNT"-1))); do
|
||||||
STORAGE_ACCOUNT_NAME=$(echo "$STORAGE_ACCOUNT_LIST" | jq .["$i"].name | tr -d '"')
|
STORAGE_ACCOUNT_NAME=$(echo "$STORAGE_ACCOUNT_LIST" | jq .["$i"].name | tr -d '"')
|
||||||
if [ "$AZURE_STORAGE_ACCOUNT" = "$STORAGE_ACCOUNT_NAME" ]; then
|
|
||||||
echo "Not checking default storage account $AZURE_STORAGE_ACCOUNT in other storage account script."
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "Checking storage account $STORAGE_ACCOUNT_NAME for old blobs."
|
echo "Checking storage account $STORAGE_ACCOUNT_NAME for old blobs."
|
||||||
|
|
||||||
CONTAINER_LIST=$(az storage container list --account-name "$STORAGE_ACCOUNT_NAME")
|
CONTAINER_LIST=$(az storage container list --account-name "$STORAGE_ACCOUNT_NAME")
|
||||||
CONTAINER_COUNT=$(echo "$CONTAINER_LIST" | jq .[].name | wc -l)
|
CONTAINER_COUNT=$(echo "$CONTAINER_LIST" | jq .[].name | wc -l)
|
||||||
for i2 in $(seq 0 $(("$CONTAINER_COUNT"-1))); do
|
for i2 in $(seq 0 $(("$CONTAINER_COUNT"-1))); do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue