11#! /bin/bash
22
3- echo cloudflare-cli: k8s-tools v0.0.21
3+ echo cloudflare-cli: k8s-tools v0.0.22
44
55bad=0
66if [ -z " $action " ]; then echo " variable 'action' is not set" ; bad=1; fi
77if [ -z " $subdomain " ]; then echo " variable 'subdomain' is not set" ; bad=1; fi
88if [ -z " $use_proxy " ]; then echo " variable 'use_proxy' is not set" ; bad=1; fi
99if [ -z " $CF_API_KEY " ]; then echo " variable 'CF_API_KEY' is not set" ; bad=1; fi
10- if [ -z " $CF_API_EMAIL " ]; then echo " variable 'CF_API_EMAIL' is not set" ; bad=1; fi
1110if [ -z " $CF_API_DOMAIN " ]; then echo " variable 'CF_API_DOMAIN' is not set" ; bad=1; fi
1211if [ $action = " create" ]; then
1312 if [ -z " $service " ]; then
@@ -18,7 +17,7 @@ if [ $action = "create" ]; then
1817fi
1918if [ $bad -eq 1 ]
2019then
21- echo " please set variables: action, subdomain, CF_API_KEY, CF_API_EMAIL, CF_API_DOMAIN"
20+ echo " please set variables: action, subdomain, CF_API_KEY, CF_API_DOMAIN"
2221 echo " if action is create, please specify these variables too: namespace, deployment, and either service or ingress"
2322 echo " valid actions: create, delete"
2423 exit 1
@@ -101,7 +100,7 @@ if [ $action = "create" ]; then
101100 retVal=$?
102101 else
103102 echo updating...
104- curl https://api.cloudflare.com/client/v4/zones/$zone_id /dns_records \
103+ curl https://api.cloudflare.com/client/v4/zones/$zone_id /dns_records/ $cloudflare_record_id \
105104 -X PATCH \
106105 -H ' Content-Type: application/json' \
107106 -H " Authorization: Bearer $CF_API_KEY " \
0 commit comments