core: 云镜像 yaml 删除空 dns 节点,避免 cloud-init 报错

This commit is contained in:
bin456789 2023-11-16 22:08:57 +08:00
parent f045ca3d41
commit e5a6877517
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -901,6 +901,9 @@ create_cloud_init_network_config() {
yq -i ".network.config[1].address += [\"$cur\"]" $ci_file
done
fi
# 如果 network.config[1] 没有 address则删除避免低版本 cloud-init 报错
yq -i 'del(.network.config[1] | select(has("address") | not))' $ci_file
}
truncate_machine_id() {