Skip to content

Commit

Permalink
Adjust e2e component
Browse files Browse the repository at this point in the history
  • Loading branch information
Kidswiss committed Mar 27, 2024
1 parent 389f4ca commit 1c69467
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 12 deletions.
18 changes: 17 additions & 1 deletion component/component/app.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
22 changes: 11 additions & 11 deletions component/component/rbac_e2e.jsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -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('schedar-e2e') + {
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 ],
};

Expand All @@ -41,17 +41,17 @@ 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',
},
},
type: 'kubernetes.io/service-account-token',
};

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 {}
9 changes: 9 additions & 0 deletions component/tests/golden/vshn/appcat/apps/appcat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
spec:
ignoreDifferences:
- group: ''
jsonPointers:
- /data/tls.crt
- /data/tls.key
kind: Secret
name: github-ci-secret
namespace: schedar-e2e

0 comments on commit 1c69467

Please sign in to comment.