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 <[email protected]>
  • Loading branch information
TheBigLee committed Nov 30, 2023
1 parent 8173d79 commit f8e2188
Show file tree
Hide file tree
Showing 26 changed files with 82 additions and 38 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
31 changes: 16 additions & 15 deletions component/class/defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ parameters:
appcat:
registry: ghcr.io
repository: vshn/appcat
tag: v4.44.0
tag: fix/missing_rbac_mariadb
apiserver:
registry: ghcr.io
repository: vshn/appcat-apiserver
Expand All @@ -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
42 changes: 42 additions & 0 deletions component/component/rbac_e2e.jsonnet
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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-e2e-tests',
},
},
};

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 ],
};

local e2eSAToken = kube.Secret('appcat-e2e-github') + {
metadata+: {
namespace: 'appcat-e2e',
annotations+: {
'kubernetes.io/service-account.name': 'appcat-e2e',
'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 ]
} else {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.44.0-func
package: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.44.0-func
package: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.44.0-func
package: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
env:
- name: PLANS_NAMESPACE
value: syn-appcat
image: ghcr.io/vshn/appcat:v4.44.0
image: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.44.0-func
package: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.44.0
image: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.44.0-func
package: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.44.0-func
package: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
data:
controlNamespace: syn-appcat-control
defaultPlan: standard-1
imageTag: v4.44.0
imageTag: fix_missing_rbac_mariadb
maintenanceSA: helm-based-service-maintenance
minioChartRepository: https://charts.min.io
minioChartVersion: 5.0.13
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
env:
- name: PLANS_NAMESPACE
value: syn-appcat
image: ghcr.io/vshn/appcat:v4.44.0
image: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
envFrom:
- secretRef:
name: appcat-sla-reports-creds
image: ghcr.io/vshn/appcat:v4.44.0
image: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb
name: sla-reporter
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.44.0
image: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.44.0-func
package: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "false"
- name: APPCAT_SLI_VSHNREDIS
value: "false"
image: ghcr.io/vshn/appcat:v4.44.0
image: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ kind: Function
metadata:
name: function-appcat
spec:
package: ghcr.io/vshn/appcat:v4.44.0-func
package: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb-func
runtimeConfigRef:
name: function-appcat
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
chartRepository: https://charts.bitnami.com/bitnami
chartVersion: 10.1.3
controlNamespace: syn-appcat-control
imageTag: v4.44.0
imageTag: fix_missing_rbac_mariadb
isOpenshift: 'false'
maintenanceSA: helm-based-service-maintenance
plans: '{"standard-1": {"size": {"cpu": "250m", "disk": "16Gi", "enabled":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1142,7 +1142,7 @@ spec:
emailAlertingSmtpHost: smtp.eu.mailgun.org:465
emailAlertingSmtpUsername: [email protected]
externalDatabaseConnectionsEnabled: 'true'
imageTag: v4.44.0
imageTag: fix_missing_rbac_mariadb
proxyEndpoint: 172.18.0.1:9443
quotasEnabled: 'false'
serviceName: postgresql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1244,7 +1244,7 @@ spec:
emailAlertingSmtpHost: smtp.eu.mailgun.org:465
emailAlertingSmtpUsername: [email protected]
externalDatabaseConnectionsEnabled: 'true'
imageTag: v4.44.0
imageTag: fix_missing_rbac_mariadb
proxyEndpoint: 172.18.0.1:9443
quotasEnabled: 'false'
serviceName: postgresql
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ spec:
emailAlertingSmtpFromAddress: [email protected]
emailAlertingSmtpHost: smtp.eu.mailgun.org:465
emailAlertingSmtpUsername: [email protected]
imageTag: v4.44.0
imageTag: fix_missing_rbac_mariadb
maintenanceSA: helm-based-service-maintenance
proxyEndpoint: 172.18.0.1:9443
quotasEnabled: 'false'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ spec:
env:
- name: PLANS_NAMESPACE
value: syn-appcat
image: ghcr.io/vshn/appcat:v4.44.0
image: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb
livenessProbe:
httpGet:
path: /healthz
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ spec:
envFrom:
- secretRef:
name: appcat-sla-reports-creds
image: ghcr.io/vshn/appcat:v4.44.0
image: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb
name: sla-reporter
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ spec:
value: "true"
- name: APPCAT_SLI_VSHNREDIS
value: "true"
image: ghcr.io/vshn/appcat:v4.44.0
image: ghcr.io/vshn/appcat:fix_missing_rbac_mariadb
livenessProbe:
httpGet:
path: /healthz
Expand Down
2 changes: 1 addition & 1 deletion package/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ parameters:
image:
registry: ghcr.io
repository: vshn/appcat
tag: v4.44.0
tag: fix/missing_rbac_mariadb
components:
appcat:
url: https://github.com/vshn/component-appcat.git
Expand Down

0 comments on commit f8e2188

Please sign in to comment.