From 9d66b6780364caffeec65b638482151849cce1ab Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Thu, 13 Jul 2023 21:11:43 +0200
Subject: [PATCH] helm fix cors unit test for helm3

---
 Jenkinsfile                                | 2 +-
 run_helm_test.sh                           | 7 +++++++
 src/test/helm/ingress_nginx_cors_test.yaml | 1 -
 3 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100755 run_helm_test.sh

diff --git a/Jenkinsfile b/Jenkinsfile
index 99a57d17..736938b6 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -155,7 +155,7 @@ pipeline {
                     dir('src/main/helm') {
                         sh "helm lint -f ../../test/unit-values.yaml"
 
-                        sh "helm unittest -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' ."
+                        sh "helm unittest --helm3 -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' ."
 
                         sh "helm package --version=${HELM_CHART_VERSION} ."
 
diff --git a/run_helm_test.sh b/run_helm_test.sh
new file mode 100755
index 00000000..7324e7d1
--- /dev/null
+++ b/run_helm_test.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+
+set -e
+
+helm template  ./src/main/helm/ -f src/test/unit-values.yaml
+helm lint -f src/test/unit-values.yaml ./src/main/helm/
+cd src/main/helm && helm unittest --helm3 -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' .
\ No newline at end of file
diff --git a/src/test/helm/ingress_nginx_cors_test.yaml b/src/test/helm/ingress_nginx_cors_test.yaml
index 9a0531a7..aa255265 100644
--- a/src/test/helm/ingress_nginx_cors_test.yaml
+++ b/src/test/helm/ingress_nginx_cors_test.yaml
@@ -39,5 +39,4 @@ tests:
                    more_set_headers "Access-Control-Allow-Methods: GET,PATCH,OPTIONS";
                    more_set_headers "Access-Control-Allow-Headers: DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization,X-XSRF-TOKEN";
                    more_set_headers "Access-Control-Expose-Headers: Content-Length,Content-Range";
-
                    more_set_headers "Access-Control-Allow-Origin: https://helm.test.sh.ozg-cloud.de";
-- 
GitLab