Skip to content

Commit a51aef1

Browse files
committed
test parent
1 parent 6f0be4b commit a51aef1

1 file changed

Lines changed: 2 additions & 8 deletions

File tree

cleanup_watcher.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,16 @@
66
for name, value in os.environ.items():
77
print("{0}: {1}".format(name, value))
88

9-
PROJECT = os.getenv("GOOGLE_CLOUD_PROJECT")
10-
REGION = os.getenv("GOOGLE_CLOUD_REGION", "us-central1")
9+
PARENT = os.getenv("PARENT")
1110
SERVICE_NAME = os.getenv("K_SERVICE")
1211

1312
HEARTBEAT_URL = "http://127.0.0.1:5000/health"
1413

1514

1615
def delete_service():
1716
print("Deleting service")
18-
for name, value in os.environ.items():
19-
print("{0}: {1}".format(name, value))
20-
if not PROJECT or not SERVICE_NAME:
21-
print("Cannot delete: missing env vars")
22-
return
2317
client = run_v2.ServicesClient()
24-
name = f"projects/{PROJECT}/locations/{REGION}/services/{SERVICE_NAME}"
18+
name = f"{PARENT}/services/{SERVICE_NAME}"
2519
try:
2620
print(f"Flask appears down → Deleting service {name}")
2721
client.delete_service(name=name)

0 commit comments

Comments
 (0)