# project must be given explicitly to fix all subsequent gcloud commands to the right cluster to avoid concurrency race conditions of any other scripts or commands in adjacent windows from switching configs and causing these commands to go to the wrong project
target_tags="$(gcloud compute firewall-rules list --filter "name~^gke-$cluster_name" --format 'get(targetTags.list())'| sort -u)"
timestamp "Determined target tags to be:"
echo
echo"$target_tags"
echo
if gcloud compute firewall-rules list --filter "name=$firewall_rule_name" --format 'get(name)'| grep -q .;then
echo"GCP firewall rule '$firewall_rule_name' for kubeseal already exists. If this is not working for you, check the target tags, port etc haven't changed"
else
timestamp "Adding a GCP firewall from master called '$firewall_rule_name' to permit IPv4 cidr '$master_ipv4_cidr' network '$network' to target tags '$target_tags'"