From e5a687751788fb4cf3ff74f664cbc31c3f9cbf3b Mon Sep 17 00:00:00 2001 From: bin456789 Date: Thu, 16 Nov 2023 22:08:57 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E4=BA=91=E9=95=9C=E5=83=8F=20yaml=20?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E7=A9=BA=20dns=20=E8=8A=82=E7=82=B9=EF=BC=8C?= =?UTF-8?q?=E9=81=BF=E5=85=8D=20cloud-init=20=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/trans.sh b/trans.sh index c331a92..9912db8 100644 --- a/trans.sh +++ b/trans.sh @@ -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() {