You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datalab.apache.org by lf...@apache.org on 2020/10/21 10:55:08 UTC

[incubator-datalab] 01/01: [DATALAB-2106]: added route removal during project termination and added required permissions for ssn

This is an automated email from the ASF dual-hosted git repository.

lfrolov pushed a commit to branch DATALAB-2106
in repository https://gitbox.apache.org/repos/asf/incubator-datalab.git

commit d95a6b4c0c8589c1031760a6feded9e44aa02081
Author: leonidfrolov <fr...@gmail.com>
AuthorDate: Wed Oct 21 13:54:37 2020 +0300

    [DATALAB-2106]: added route removal during project termination and added required permissions for ssn
---
 infrastructure-provisioning/src/general/files/gcp/ssn_policy.json | 3 ++-
 .../src/general/scripts/gcp/project_terminate.py                  | 8 ++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/infrastructure-provisioning/src/general/files/gcp/ssn_policy.json b/infrastructure-provisioning/src/general/files/gcp/ssn_policy.json
index 4f0ad6a..843a452 100644
--- a/infrastructure-provisioning/src/general/files/gcp/ssn_policy.json
+++ b/infrastructure-provisioning/src/general/files/gcp/ssn_policy.json
@@ -18,5 +18,6 @@
     "compute.images.setLabels",
     "compute.images.list",
     "compute.routes.create",
-    "compute.routes.get"
+    "compute.routes.get",
+    "compute.routes.delete"
 ]
\ No newline at end of file
diff --git a/infrastructure-provisioning/src/general/scripts/gcp/project_terminate.py b/infrastructure-provisioning/src/general/scripts/gcp/project_terminate.py
index 706885e..a2b6416 100644
--- a/infrastructure-provisioning/src/general/scripts/gcp/project_terminate.py
+++ b/infrastructure-provisioning/src/general/scripts/gcp/project_terminate.py
@@ -139,6 +139,14 @@ def terminate_edge_node(endpoint_name, project_name, service_base_name, region,
         datalab.fab.append_result("Failed to remove subnets", str(err))
         sys.exit(1)
 
+    print("Removing nat route")
+    try:
+        nat_route_name = '{0}-{1}-{2}-nat-route'.format(service_base_name, project_name, endpoint_name)
+        GCPActions.delete_nat_route(nat_route_name)
+    except Exception as err:
+        datalab.fab.append_result("Failed to remove nat route", str(err))
+        sys.exit(1)
+
 
 if __name__ == "__main__":
     local_log_filename = "{}_{}_{}.log".format(os.environ['conf_resource'], os.environ['project_name'],


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datalab.apache.org
For additional commands, e-mail: commits-help@datalab.apache.org