From bd4b3b6cf4343092fe948442747f3492e75eec36 Mon Sep 17 00:00:00 2001
From: OZGCloud <ozgcloud@mgm-tp.com>
Date: Tue, 19 Dec 2023 11:22:53 +0100
Subject: [PATCH] OZG-3880 network policy dynamic dns server config

---
 Jenkinsfile                            |  2 +-
 src/test/helm/network_policy_test.yaml | 15 +++++++++++++++
 src/test/unit-values.yaml              |  1 -
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/Jenkinsfile b/Jenkinsfile
index 3d70124a..999c2844 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -160,7 +160,7 @@ pipeline {
                     HELM_CHART_VERSION = generateHelmChartVersion()
 
                     dir('src/main/helm') {
-                        sh "helm lint -f ../../test/unit-values.yaml"
+                        sh "helm lint -f ../../test/linter-values.yaml"
 
                         sh "helm unittest --helm3 -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' ."
 
diff --git a/src/test/helm/network_policy_test.yaml b/src/test/helm/network_policy_test.yaml
index a2880b89..66da8d8e 100644
--- a/src/test/helm/network_policy_test.yaml
+++ b/src/test/helm/network_policy_test.yaml
@@ -29,14 +29,23 @@ templates:
   - templates/network_policy.yaml
 tests:
   - it: should match apiVersion
+    set:
+      networkPolicy:
+        dnsServerNamespace: test-namespace-dns
     asserts:
       - isAPIVersion:
           of: networking.k8s.io/v1
   - it: should match kind
+    set:
+      networkPolicy:
+        dnsServerNamespace: test-namespace-dns
     asserts:
       - isKind:
           of: NetworkPolicy
   - it: validate metadata
+    set:
+      networkPolicy:
+        dnsServerNamespace: test-namespace-dns
     asserts:
       - equal:
           path: metadata
@@ -44,6 +53,9 @@ tests:
             name: network-policy-user-manager
             namespace: by-helm-test
   - it: validate spec
+    set:
+      networkPolicy:
+        dnsServerNamespace: test-namespace-dns
     asserts:
       - equal:
           path: spec
@@ -81,6 +93,7 @@ tests:
   - it: add ingress rule by values
     set:
       networkPolicy:
+        dnsServerNamespace: test-namespace-dns
         additionalIngressConfig:
         - podSelector: 
             matchLabels:
@@ -99,6 +112,7 @@ tests:
   - it: test network policy disabled
     set:
       networkPolicy:
+        dnsServerNamespace: test-namespace-dns
         disabled: true
     asserts:
       - hasDocuments:
@@ -107,6 +121,7 @@ tests:
   - it: test network policy unset should be disabled
     set:
       networkPolicy:
+        dnsServerNamespace: test-namespace-dns
         disabled: false
     asserts:
       - hasDocuments:
diff --git a/src/test/unit-values.yaml b/src/test/unit-values.yaml
index 41c86791..3beed747 100644
--- a/src/test/unit-values.yaml
+++ b/src/test/unit-values.yaml
@@ -37,4 +37,3 @@ sso:
   
 networkPolicy:
   ssoPublicIp: 51.89.117.53/32
-  dnsServerNamespace: test-namespace-dns
\ No newline at end of file
-- 
GitLab