Skip to content

Commit

Permalink
Add e2e smoke test for MariaDB
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Bigler <nicolas.bigler@vshn.ch>
  • Loading branch information
TheBigLee committed Nov 29, 2023
1 parent 2c8eaea commit 35b5e73
Show file tree
Hide file tree
Showing 3 changed files with 47 additions and 14 deletions.
1 change: 1 addition & 0 deletions component/class/appcat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ parameters:
- ${_base_directory}/component/statefuleset-resize-controller.jsonnet
- ${_base_directory}/component/functions.jsonnet
- ${_base_directory}/component/vshn_appcat_services.jsonnet
- ${_base_directory}/component/rbac_e2e.jsonnet
input_type: jsonnet
output_path: appcat/

Expand Down
29 changes: 15 additions & 14 deletions component/class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,46 +69,46 @@ parameters:
grpcEndpoint: host.docker.internal:9443
defaultRestoreRoleRules:
- apiGroups:
- vshn.appcat.vshn.io
- vshn.appcat.vshn.io
resources:
- vshnredis
- vshnredis
verbs:
- get
- get
- apiGroups:
- 'k8up.io'
- "k8up.io"
resources:
- snapshots
verbs:
- get
- apiGroups:
- ''
- ""
resources:
- secrets
verbs:
- get
- create
- delete
- apiGroups:
- apps
- apps
resources:
- statefulsets/scale
- statefulsets/scale
verbs:
- update
- patch
- apiGroups:
- apps
- apps
resources:
- statefulsets
verbs:
- get
- apiGroups:
- batch
- batch
resources:
- jobs
verbs:
- get
- apiGroups:
- ''
- ""
resources:
- events
verbs:
Expand Down Expand Up @@ -292,6 +292,7 @@ parameters:
vshn:
enabled: false
externalDatabaseConnectionsEnabled: "false"
e2eTests: false
quotasEnabled: ${appcat:quotasEnabled}
secretNamespace: ${crossplane:namespace}
emailAlerting:
Expand Down Expand Up @@ -511,12 +512,12 @@ parameters:
hasSts: true
openshiftTemplate:
serviceName: mariadbbyvshn
description: 'The open source relational database management system (DBMS) that is a compatible drop-in replacement for the widely used MySQL database technology'
description: "The open source relational database management system (DBMS) that is a compatible drop-in replacement for the widely used MySQL database technology"
message: 'Your MariaDB by VSHN instance is being provisioned, please see \${SECRET_NAME} for access.'
url: https://vs.hn/vshn-mariadb
tags: 'database,sql,mariadb'
icon: 'icon-mariadb'
defaultVersion: '11.2'
tags: "database,sql,mariadb"
icon: "icon-mariadb"
defaultVersion: "11.2"
enableNetworkPolicy: false
secretNamespace: ${appcat:services:vshn:secretNamespace}
helmChartVersion: ${appcat:charts:mariadb:version}
Expand Down
31 changes: 31 additions & 0 deletions component/component/rbac_e2e.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
local kap = import 'lib/kapitan.libjsonnet';
local kube = import 'lib/kube.libjsonnet';

local inv = kap.inventory();
local params = inv.parameters.appcat;

local e2eNs = kube.Namespace('appcat-e2e') + {
metadata+: {
labels+: {
'appuio.io/organization': 'vshn',
},
},
};

local e2eSA = kube.ServiceAccount('appcat-e2e') + {
metadata+: {
namespace: 'appcat-e2e',
},
};

local e2eRoleBinding = kube.RoleBinding('appcat-e2e') + {
metadata+: {
namespace: 'appcat-e2e',
},
roleRef_: kube.ClusterRole('admin'),
subjects_: [ e2eSA ],
};

if params.services.vshn.e2eTests then {
'20_rbac_vshn_e2e_tests': [ e2eSA, e2eRoleBinding ]
} else {}

0 comments on commit 35b5e73

Please sign in to comment.