从 ACR 中获取不以前缀开头的最新图像

Fetch the latest image from ACR that doesn't start with a prefix

我将从 ACR 存储库中获取不包含特定前缀的最新图像: 这是我现在拥有的:

$ az acr repository show-tags --name myacr --repository myrepo --orderby time_desc --top 1 --output tsv

图片列表如下:

"prefix-7471",
"prefix-7470",
"7469",
"prefix-7467",
"prefix-7466",
"prefix-7459",
"7455",
...

以上命令显示标签:"prefix-7471" 作为输出,但我希望它获取标签:“7469”

我能得到这个吗?

使用 grep 怎么样?

az acr repository show-tags --name myacr --repository myrepo --orderby time_desc \
    --output tsv | grep -v "prefix"

然后你可以从输出中取出第一个字符串

ps。我不认为你可以做 notcontains jmespath 查询?