Skip to content

Commit ade4913

Browse files
authored
Update container-registry-delete.md
1 parent bea6631 commit ade4913

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

articles/container-registry/container-registry-delete.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ The following Azure CLI command lists all manifest digests in a repository older
107107

108108
```azurecli
109109
az acr manifest list-metadata --name <repositoryName> --registry <acrName> <repositoryName> \
110-
--orderby time_asc -o tsv --query "[?timestamp < '2019-04-05'].[digest, timestamp]"
110+
--orderby time_asc -o tsv --query "[?lastUpdateTime < '2019-04-05'].[digest, lastUpdateTime]"
111111
```
112112

113113
After identifying stale manifest digests, you can run the following Bash script to delete manifest digests older than a specified timestamp. It requires the Azure CLI and **xargs**. By default, the script performs no deletion. Change the `ENABLE_DELETE` value to `true` to enable image deletion.
@@ -136,13 +136,13 @@ TIMESTAMP=2019-04-05
136136
if [ "$ENABLE_DELETE" = true ]
137137
then
138138
az acr manifest list-metadata --name $REPOSITORY --registry $REGISTRY \
139-
--orderby time_asc --query "[?timestamp < '$TIMESTAMP'].digest" -o tsv \
139+
--orderby time_asc --query "[?lastUpdateTime < '$TIMESTAMP'].digest" -o tsv \
140140
| xargs -I% az acr repository delete --name $REGISTRY --image $REPOSITORY@% --yes
141141
else
142142
echo "No data deleted."
143143
echo "Set ENABLE_DELETE=true to enable deletion of these images in $REPOSITORY:"
144-
az acr manifest list-metadata --name $REPOSITORY --repository $REGISTRY \
145-
--orderby time_asc --query "[?timestamp < '$TIMESTAMP'].[digest, timestamp]" -o tsv
144+
az acr manifest list-metadata --name $REPOSITORY --registry $REGISTRY \
145+
--orderby time_asc --query "[?lastUpdateTime < '$TIMESTAMP'].[digest, lastUpdateTime]" -o tsv
146146
fi
147147
```
148148

0 commit comments

Comments
 (0)