fix: 调整 dectl 清理旧镜像时的判断逻辑

This commit is contained in:
xuwei-fit2cloud 2024-03-20 10:49:51 +08:00
parent df5d98927e
commit f278343998

View File

@ -301,7 +301,7 @@ function clear_images() {
component_version=$(echo ${component_image_defined} | awk -F":" '{print $3}' | uniq)
component_image=$(echo ${component_image_defined} | awk -F'image: ' '{print $2}' | awk -F':' '{print $1}')
if test -z $(docker images | grep "$component_image" | grep -v " $component_version "); then
if [[ $(docker images | grep "$component_image" | grep -v " $component_version ") == 0 ]]; then
echo "$component_image 不存在旧版本镜像"
else
echo "存在旧版本镜像 : "