Skip to content

Commit

Permalink
fix health check resources issue
Browse files Browse the repository at this point in the history
  • Loading branch information
heliubj18 committed May 27, 2024
1 parent fd8a7e6 commit b21d3de
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,20 @@ fi
tags=$(jq -r '.spec.additionalTags //""' < "${capi_cp_json_file}")
if [[ -n "${tags}" ]]; then
echo "check rosacontrolplane additionalTags"
hc_dft_sg=$(cat "${SHARED_DIR}/capi_hcp_default_security_group")
hc_dft_sg=""
if [[ -f "${SHARED_DIR}/capi_hcp_default_security_group" ]] ; then
hc_dft_sg=$(cat "${SHARED_DIR}/capi_hcp_default_security_group")
else
cluster_id=$(cat "${SHARED_DIR}/cluster-id")
hc_vpc_id=$(cat "${SHARED_DIR}/vpc_id")
hc_dft_sg=$(aws ec2 describe-security-groups --region ${REGION} --filters "Name=vpc-id,Values=${hc_vpc_id}" "Name=group-name,Values=${cluster_id}-default-sg" --query 'SecurityGroups[].GroupId' --output text)
fi

if [[ -z "${hc_dft_sg}" ]] ; then
echo "default security group not found error"
exit 1
fi

echo "${tags}" | jq -r 'to_entries[] | "\(.key) \(.value)"' | while read key value; do
contain_key=$(jq -e '.aws.tags | contains({"'"${key}"'": "'"${value}"'"})' < "${rosa_hcp_info_file}")
if [[ "${contain_key}" != "true" ]] ; then
Expand Down

0 comments on commit b21d3de

Please sign in to comment.