SITE_NAMESPACE="${SITE_NAMESPACE:-metal3}"
function _gpg_key_fp {
- gpg --with-colons --list-secret-keys $1 | awk -F: '/fpr/ {print $10;exit}'
+ gpg --with-colons --fingerprint $1 | awk -F: '/fpr/ {print $10;exit}'
}
function sops_encrypt {
wait_for _is_cluster_ready
for yaml in ${SCRIPTDIR}/deployment/*.yaml; do
name=$(awk '/clusterName:/ {print $2}' ${yaml})
- clusterctl -n ${SITE_NAMESPACE} get kubeconfig ${name} >${BUILDDIR}/${name}-admin.conf
- chmod 600 ${BUILDDIR}/${name}-admin.conf
+ if [[ ! -z ${name} ]]; then
+ clusterctl -n ${SITE_NAMESPACE} get kubeconfig ${name} >${BUILDDIR}/${name}-admin.conf
+ chmod 600 ${BUILDDIR}/${name}-admin.conf
+ fi
done
wait_for _is_control_plane_ready
}
function _is_cluster_deleted {
for yaml in ${SCRIPTDIR}/deployment/*.yaml; do
name=$(awk '/clusterName:/ {print $2}' ${yaml})
- ! kubectl -n ${SITE_NAMESPACE} get cluster ${name}
+ if [[ ! -z ${name} ]]; then
+ if kubectl -n ${SITE_NAMESPACE} get cluster ${name}; then
+ return 1
+ fi
+ fi
done
}