Skip to content

Commit 5112097

Browse files
committed
Export backup location with ca cert
Signed-off-by: Willis Ren <willis.ren@broadcom.com>
1 parent cfbe35f commit 5112097

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

027-cluster-data_protection-export.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ mkdir -p ${DPDIR}
1818
# Save backup location for both org and clsuter
1919
echo "Saving backup-location ......"
2020
tanzu tmc data-protection backup-location list -o yaml -s org > ${DPDIR}/backup_location_org.yaml
21+
i=0
22+
while read -r name; do
23+
ca_certs=$(tanzu tmc data-protection backup-location get ${name} -o yaml | yq -r '.spec.caCert')
24+
yq -i ".backupLocations[$i].spec.caCert=\"${ca_certs}\"" ${DPDIR}/backup_location_org.yaml
25+
i=$((i+1))
26+
done < <(yq -r '.backupLocations[] | .fullName.name' ${DPDIR}/backup_location_org.yaml)
27+
2128
tanzu tmc data-protection backup-location list -o yaml -s cluster > ${DPDIR}/backup_location_cluster.yaml
2229

2330
# Save schedule

0 commit comments

Comments
 (0)