From 05438fd75decc30f7e8e6ff72ca303d82d95817e Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Wed, 3 Apr 2024 16:19:32 +0200
Subject: [PATCH] OZG-3328 outsource elasticsearch operatot required values to
 gitops and linter values

---
 ozgcloud-elasticsearch-operator/src/main/helm/values.yaml   | 4 ----
 .../src/test/helm/deployment_container_test.yaml            | 4 ++++
 .../src/test/helm/deployment_env_customList_test.yaml       | 6 +++++-
 .../src/test/helm/deployment_matchlabels_test.yaml          | 5 +++++
 .../src/test/helm/deployment_metadata_test.yaml             | 5 +++++
 .../src/test/helm/deployment_pull_secret_test.yaml          | 5 +++++
 .../src/test/helm/deployment_resources_test.yaml            | 4 ++++
 .../src/test/helm/deployment_template_spec_test.yaml        | 4 ++++
 .../src/test/helm/deployment_type_test.yaml                 | 4 ++++
 .../src/test/helm/deployment_volumes_test.yaml              | 4 ++++
 .../src/test/helm/linter_values.yaml                        | 4 ++++
 ..._elasticsearch_operator_admin_secret_view_role_test.yaml | 5 +++++
 ...csearch_operator_admin_secret_view_rolebinding_test.yaml | 5 +++++
 13 files changed, 54 insertions(+), 5 deletions(-)

diff --git a/ozgcloud-elasticsearch-operator/src/main/helm/values.yaml b/ozgcloud-elasticsearch-operator/src/main/helm/values.yaml
index e4b3820..f35d5cb 100644
--- a/ozgcloud-elasticsearch-operator/src/main/helm/values.yaml
+++ b/ozgcloud-elasticsearch-operator/src/main/helm/values.yaml
@@ -2,7 +2,3 @@
 image:
   repo: docker.ozg-sh.de
 
-elasticsearch:
-    namespace: elastic-system
-    adminSecretName: ozg-search-cluster-es-elastic-user
-    certificateSecretName: ozg-search-cluster-es-http-ca-internal
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml
index 56ca883..a2ce802 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_container_test.yaml
@@ -33,6 +33,10 @@ set:
     name: hase
     tag: latest
   imagePullSecret: imagePullSecret
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
 tests:
   - it: validate image type and container image
     asserts:
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_customList_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_customList_test.yaml
index 0179c95..49a663b 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_customList_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_env_customList_test.yaml
@@ -25,9 +25,13 @@
 suite: test environments
 templates:
   - templates/deployment.yaml
+set: 
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
 tests:
   - it: check customList
-    template: deployment.yaml
     set:
       env.customList:
         - name: my_test_environment_name
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_matchlabels_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_matchlabels_test.yaml
index 720c452..2a9a136 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_matchlabels_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_matchlabels_test.yaml
@@ -28,6 +28,11 @@ release:
   namespace: sh-helm-test
 templates:
   - templates/deployment.yaml
+set: 
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
 tests:
   - it: check matchlabels
     set:
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml
index d39d576..ac3b5f3 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_metadata_test.yaml
@@ -33,6 +33,11 @@ set:
     name: hase
     tag: latest
   imagePullSecret: imagePullSecret
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
+
 tests:
   - it: check metadata labels
     asserts:
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_pull_secret_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_pull_secret_test.yaml
index 983d275..b7da864 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_pull_secret_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_pull_secret_test.yaml
@@ -28,6 +28,11 @@ release:
   namespace: sh-helm-test
 templates:
   - deployment.yaml
+set: 
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
 tests:
   - it: validate image pull secret resource name
     set:
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml
index cff78ba..c6ad869 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_resources_test.yaml
@@ -32,6 +32,10 @@ set:
     name: hase
     tag: latest
   imagePullSecret: imagePullSecret
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
 tests:
   - it: test resources
     set:
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml
index 1aa878d..e451cbd 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_template_spec_test.yaml
@@ -33,6 +33,10 @@ set:
     name: hase
     tag: latest
   imagePullSecret: imagePullSecret  
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
 tests:
   - it: validate serviceaccount name
     asserts:
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml
index 8216a62..5da0372 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_type_test.yaml
@@ -33,6 +33,10 @@ set:
     name: hase
     tag: latest
   imagePullSecret: imagePullSecret
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
 tests:
   - it: validate template type and api Version
     asserts:
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes_test.yaml
index db2cdd1..1130519 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/deployment_volumes_test.yaml
@@ -34,6 +34,10 @@ set:
     name: hase
     tag: latest
   imagePullSecret: imagePullSecret
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
 tests:
   - it: should create SERVICE_BINDING_ROOT
     asserts:
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml
index a27fd79..1054323 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/linter_values.yaml
@@ -5,3 +5,7 @@ image:
 
 imagePullSecret: "docker-secret"
 
+elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
\ No newline at end of file
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_role_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_role_test.yaml
index 9604c57..e24ec69 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_role_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_role_test.yaml
@@ -28,6 +28,11 @@ release:
   namespace: test-namespace
 templates:
   - templates/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_role.yaml
+set: 
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
 tests:
   - it: should have apiVersion
     asserts: 
diff --git a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_rolebinding_test.yaml b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_rolebinding_test.yaml
index 9cde6cc..84c5275 100644
--- a/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_rolebinding_test.yaml
+++ b/ozgcloud-elasticsearch-operator/src/test/helm/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_rolebinding_test.yaml
@@ -28,6 +28,11 @@ release:
   namespace: sh-helm-test
 templates:
   - templates/rbac/ozgcloud_elasticsearch_operator_admin_secret_view_rolebinding.yaml
+set: 
+  elasticsearch:
+    namespace: elastic-system
+    adminSecretName: ozg-search-cluster-es-elastic-user
+    certificateSecretName: ozg-search-cluster-es-http-ca-internal
 tests:
   - it: should have apiVersion
     asserts: 
-- 
GitLab