From 51e95d997f2e3b64bd40edbd259d6d7e18ba0955 Mon Sep 17 00:00:00 2001
From: "Siarhei Poliak [EPAM / GCP]" <siarhei_poliak@epam.com>
Date: Mon, 25 Mar 2024 13:16:29 +0000
Subject: [PATCH] Gonrg 9457 remove schema clean feature

---
 NOTICE                                         |  5 ++---
 devops/gc/bootstrap-osdu-module/Dockerfile     |  3 +--
 .../bootstrap-osdu-module/bootstrap_schema.sh  | 18 ------------------
 .../deploy/templates/configmap-bootstrap.yaml  |  8 +-------
 devops/gc/deploy/values.yaml                   |  4 ----
 5 files changed, 4 insertions(+), 34 deletions(-)

diff --git a/NOTICE b/NOTICE
index a70623321..ad569246e 100644
--- a/NOTICE
+++ b/NOTICE
@@ -83,8 +83,8 @@ The following software have components provided under the terms of this license:
 - Byte Buddy (without dependencies) (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy)
 - Byte Buddy Java agent (from https://repo1.maven.org/maven2/net/bytebuddy/byte-buddy-agent)
 - ClassMate (from http://github.com/cowtowncoder/java-classmate)
-- Cloud Key Management Service (KMS) API v1-rev20240131-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
-- Cloud Storage JSON API v1-rev20240209-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
+- Cloud Key Management Service (KMS) API v1-rev20240219-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-cloudkms)
+- Cloud Storage JSON API v1-rev20240311-2.0.0 (from https://repo1.maven.org/maven2/com/google/apis/google-api-services-storage)
 - Collections (from https://repo1.maven.org/maven2/commons-collections/commons-collections)
 - Commons Digester (from http://commons.apache.org/digester/)
 - Converter: Jackson (from https://github.com/square/retrofit, https://repo1.maven.org/maven2/com/squareup/retrofit2/converter-jackson)
@@ -728,7 +728,6 @@ gpl-2.0-classpath
 The following software have components provided under the terms of this license:
 
 - Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca)
-- Jakarta Validation API (from https://beanvalidation.org)
 
 ========================================================================
 public-domain
diff --git a/devops/gc/bootstrap-osdu-module/Dockerfile b/devops/gc/bootstrap-osdu-module/Dockerfile
index 73c4dcb98..f95c75817 100644
--- a/devops/gc/bootstrap-osdu-module/Dockerfile
+++ b/devops/gc/bootstrap-osdu-module/Dockerfile
@@ -9,8 +9,7 @@ COPY ./deployments ./
 RUN apk update && apk add jq bash py3-pip
 RUN pip3 install --upgrade pip && \ 
   pip3 install -r ./scripts/requirements.txt && \
-  pip3 install -r ./scripts/gc-deployment-requirements.txt && \
-  pip3 install -r ./scripts/schema-cleaner/requirements.txt
+  pip3 install -r ./scripts/gc-deployment-requirements.txt
 RUN chmod +x /opt/bootstrap_schema.sh
 RUN addgroup -g 10001 -S nonroot \
   && adduser -h /opt -G nonroot -S -u 10001 nonroot
diff --git a/devops/gc/bootstrap-osdu-module/bootstrap_schema.sh b/devops/gc/bootstrap-osdu-module/bootstrap_schema.sh
index 6d4562cb6..e40ce9e74 100644
--- a/devops/gc/bootstrap-osdu-module/bootstrap_schema.sh
+++ b/devops/gc/bootstrap-osdu-module/bootstrap_schema.sh
@@ -14,18 +14,11 @@
 # - OPENID_PROVIDER_URL
 # - OPENID_PROVIDER_CLIENT_ID
 # - OPENID_PROVIDER_CLIENT_SECRET
-# (with datastore cleanup)
-# - SCHEMA_BUCKET
-# - DATASTORE_NAMESPACE
-# - DATASTORE_KIND
-# - ENABLE_CLEANUP
-#
 
 set -e
 
 source ./validate-env.sh "SCHEMA_URL"
 source ./validate-env.sh "ENTITLEMENTS_HOST"
-source ./validate-env.sh "ENABLE_CLEANUP"
 
 bootstrap_schema_gettoken_onprem() {
 
@@ -81,19 +74,8 @@ else
   # Specifying "system" partition for GC installation 
   export DATA_PARTITION="system"
 
-  if [ "${ENABLE_CLEANUP}" == "true" ]
-  then
-    source ./validate-env.sh "SCHEMA_BUCKET"
-    source ./validate-env.sh "DATASTORE_NAMESPACE"
-    source ./validate-env.sh "DATASTORE_KIND"
-    echo "Started schema cleanup"
-    python3 ./scripts/schema-cleaner/main.py -u "${SCHEMA_URL}"/api/schema-service/v1/schemas/system
-    echo "Finished schema cleanup"
-  fi
-
   # Get credentials for Google Cloud
   bootstrap_schema_gettoken_gc
-
 fi
 
 # Precheck entitlements
diff --git a/devops/gc/deploy/templates/configmap-bootstrap.yaml b/devops/gc/deploy/templates/configmap-bootstrap.yaml
index 5d91485fc..542c42354 100644
--- a/devops/gc/deploy/templates/configmap-bootstrap.yaml
+++ b/devops/gc/deploy/templates/configmap-bootstrap.yaml
@@ -10,11 +10,5 @@ data:
   DATA_PARTITION: {{ .Values.global.dataPartitionId | quote }}
   {{- end }}
   ONPREM_ENABLED: {{ .Values.global.onPremEnabled | quote }}
-  ENABLE_CLEANUP: {{ .Values.data.enableCleanup | quote }}
   SCHEMA_URL: {{ .Values.data.schemaHost | quote }}
-  ENTITLEMENTS_HOST: {{ .Values.data.entitlementsHost | quote }}
-  {{- if .Values.data.enableCleanup }}
-  SCHEMA_BUCKET: {{ .Values.data.schemaBucket | quote }}
-  DATASTORE_NAMESPACE: {{ .Values.data.datastoreNamespace | quote }}
-  DATASTORE_KIND: {{ .Values.data.datastoreKind | quote }}
-  {{- end }}  
+  ENTITLEMENTS_HOST: {{ .Values.data.entitlementsHost | quote }} 
diff --git a/devops/gc/deploy/values.yaml b/devops/gc/deploy/values.yaml
index cf9ff6528..665a3d6bc 100644
--- a/devops/gc/deploy/values.yaml
+++ b/devops/gc/deploy/values.yaml
@@ -12,10 +12,6 @@ data:
   partitionHost: "http://partition"
   schemaTopicName: "schema-changed"
   schemaChangedMessagingEnabled: true
-  datastoreKind: "system_schema_osm"
-  datastoreNamespace: "dataecosystem"
-  enableCleanup: false
-  schemaBucket: ""
   schemaHost: "http://schema"
   #Deployments
   requestsCpu: "220m"
-- 
GitLab