From 1df15209be4342c670dd9a8d6559b1497dd33b0d Mon Sep 17 00:00:00 2001 From: Simon Beck Date: Wed, 27 Mar 2024 10:36:31 +0100 Subject: [PATCH] Adjust e2e component --- component/component/app.jsonnet | 18 ++++++++++++++- component/component/rbac_e2e.jsonnet | 22 +++++++++---------- .../tests/golden/vshn/appcat/apps/appcat.yaml | 9 ++++++++ 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/component/component/app.jsonnet b/component/component/app.jsonnet index 2fc6e2634..ee1e12834 100644 --- a/component/component/app.jsonnet +++ b/component/component/app.jsonnet @@ -3,7 +3,23 @@ local inv = kap.inventory(); local params = inv.parameters.appcat; local argocd = import 'lib/argocd.libjsonnet'; -local app = argocd.App('appcat', ''); +local app = argocd.App('appcat', '') + ( + if params.services.vshn.e2eTests then { + spec+: { + ignoreDifferences+: [ + { + group: '', + jsonPointers: [ + '/data', + ], + kind: 'Secret', + name: 'github-ci-secret', + namespace: 'schedar-e2e', + }, + ], + }, + } else {} +); { appcat: app, diff --git a/component/component/rbac_e2e.jsonnet b/component/component/rbac_e2e.jsonnet index acee5d75d..e8476a989 100644 --- a/component/component/rbac_e2e.jsonnet +++ b/component/component/rbac_e2e.jsonnet @@ -4,25 +4,25 @@ local kube = import 'lib/kube.libjsonnet'; local inv = kap.inventory(); local params = inv.parameters.appcat; -local e2eNs = kube.Namespace('appcat-e2e') + { +local e2eNs = kube.Namespace('schedar-e2e') + { metadata+: { labels+: { - 'appuio.io/organization': 'vshn-e2e-tests', + 'appuio.io/organization': 'vshn', }, }, }; -local e2eSA = kube.ServiceAccount('appcat-e2e') + { +local e2eSA = kube.ServiceAccount('github-ci') + { metadata+: { - namespace: 'appcat-e2e', + namespace: 'schedar-e2e', }, }; -local e2eRoleBinding = kube.RoleBinding('appcat-e2e') + { +local e2eRoleBinding = kube.RoleBinding('schedar-e2e') + { metadata+: { - namespace: 'appcat-e2e', + namespace: 'schedar-e2e', }, - roleRef_: kube.ClusterRole('admin'), + roleRef_: kube.ClusterRole('gitlab-ci'), subjects_: [ e2eSA ], }; @@ -41,11 +41,11 @@ local e2eClusterRoleBinding = kube.ClusterRoleBinding('appcat:e2e') { subjects_: [ e2eSA ], }; -local e2eSAToken = kube.Secret('appcat-e2e-github') + { +local e2eSAToken = kube.Secret('github-ci-secret') + { metadata+: { - namespace: 'appcat-e2e', + namespace: 'schedar-e2e', annotations+: { - 'kubernetes.io/service-account.name': 'appcat-e2e', + 'kubernetes.io/service-account.name': 'github-ci', 'argocd.argoproj.io/compare-options': 'IgnoreExtraneous', }, }, @@ -53,5 +53,5 @@ local e2eSAToken = kube.Secret('appcat-e2e-github') + { }; if params.services.vshn.e2eTests then { - '20_rbac_vshn_e2e_tests': [ e2eNs, e2eSA, e2eRoleBinding, e2eSAToken, e2eClusterRoleBinding, e2eClusterRole ], + '20_rbac_vshn_e2e_tests': [ e2eNs, e2eSA, e2eRoleBinding, e2eClusterRoleBinding, e2eClusterRole, e2eSAToken ], } else {} diff --git a/component/tests/golden/vshn/appcat/apps/appcat.yaml b/component/tests/golden/vshn/appcat/apps/appcat.yaml index e69de29bb..69baf59c7 100644 --- a/component/tests/golden/vshn/appcat/apps/appcat.yaml +++ b/component/tests/golden/vshn/appcat/apps/appcat.yaml @@ -0,0 +1,9 @@ +spec: + ignoreDifferences: + - group: '' + jsonPointers: + - /data/tls.crt + - /data/tls.key + kind: Secret + name: github-ci-secret + namespace: schedar-e2e