feat(common)!: Migrate library chart

This commit is contained in:
Bᴇʀɴᴅ Sᴄʜᴏʀɢᴇʀs 2022-08-07 11:45:41 +02:00
parent 49ebc2bb2f
commit a1a80f5ff5
No known key found for this signature in database
GPG key ID: BC5E2BD907F9A8EC
59 changed files with 499 additions and 885 deletions

View file

@ -0,0 +1,167 @@
suite: addon codeserver
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
not: true
equal:
path: spec.template.spec.containers[0].name
value: codeserver
- it: addon enabled should pass
set:
addons:
codeserver:
enabled: true
volumeMounts:
- name: "config"
mountPath: "/data/config"
asserts:
- hasDocuments:
count: 3
- documentIndex: 0
isKind:
of: Service
- documentIndex: &DeploymentDocument 1
isKind:
of: Deployment
- documentIndex: &AddonServiceDocument 2
isKind:
of: Service
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].name
value: codeserver
- documentIndex: *AddonServiceDocument
equal:
path: metadata.name
value: RELEASE-NAME-common-chart
- it: addon enabled with deployKey should pass
set:
addons:
codeserver:
enabled: true
git:
deployKey: test
volumeMounts:
- name: "config"
mountPath: "/data/config"
asserts:
- hasDocuments:
count: 4
- documentIndex: &AddonDeployKeySecretDocument 0
isKind:
of: Secret
- documentIndex: &DeploymentDocument 2
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /root/.ssh/id_rsa
name: deploykey
subPath: id_rsa
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.volumes
content:
name: deploykey
secret:
defaultMode: 256
items:
- key: id_rsa
path: id_rsa
secretName: RELEASE-NAME-common-chart-deploykey
- documentIndex: *AddonDeployKeySecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-common-chart-deploykey
- it: addon enabled with InlineBase64 deployKey should pass
set:
addons:
codeserver:
enabled: true
git:
deployKeyBase64: dGVzdEtleQ==
volumeMounts:
- name: "config"
mountPath: "/data/config"
asserts:
- hasDocuments:
count: 4
- documentIndex: &AddonDeployKeySecretDocument 0
isKind:
of: Secret
- documentIndex: &DeploymentDocument 2
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /root/.ssh/id_rsa
name: deploykey
subPath: id_rsa
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.volumes
content:
name: deploykey
secret:
defaultMode: 256
items:
- key: id_rsa
path: id_rsa
secretName: RELEASE-NAME-common-chart-deploykey
- documentIndex: *AddonDeployKeySecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-common-chart-deploykey
- it: addon enabled with existingSecret deployKey should pass
set:
addons:
codeserver:
enabled: true
git:
deployKeySecret: test-secret
volumeMounts:
- name: "config"
mountPath: "/data/config"
asserts:
- hasDocuments:
count: 3
- documentIndex: &DeploymentDocument 1
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /root/.ssh/id_rsa
name: deploykey
subPath: id_rsa
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.volumes
content:
name: deploykey
secret:
defaultMode: 256
items:
- key: id_rsa
path: id_rsa
secretName: test-secret

View file

@ -0,0 +1,38 @@
suite: addon netshoot
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
not: true
equal:
path: spec.template.spec.containers[0].name
value: netshoot
- it: addon enabled should pass
set:
addons:
netshoot:
enabled: true
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].name
value: netshoot

View file

@ -0,0 +1,180 @@
suite: addon vpn
templates:
- common.yaml
tests:
- it: default should pass
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
not: true
equal:
path: spec.template.spec.containers[0].name
value: vpn
- it: addon enabled should pass
set:
addons:
vpn:
enabled: true
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].name
value: openvpn
- it: addon enabled with configFile should pass
set:
addons:
vpn:
enabled: true
configFile: test
asserts:
- hasDocuments:
count: 3
- documentIndex: &AddonVPNConfigSecretDocument 0
isKind:
of: Secret
- documentIndex: &DeploymentDocument 1
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /vpn/vpn.conf
name: vpnconfig
subPath: vpnConfigfile
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.volumes
content:
name: vpnconfig
secret:
items:
- key: vpnConfigfile
path: vpnConfigfile
secretName: RELEASE-NAME-common-chart-vpnconfig
- documentIndex: *AddonVPNConfigSecretDocument
equal:
path: metadata.name
value: RELEASE-NAME-common-chart-vpnconfig
- it: addon enabled with existing configFile secret should pass
set:
addons:
vpn:
enabled: true
configFileSecret: test-secret
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.containers[1].volumeMounts
content:
mountPath: /vpn/vpn.conf
name: vpnconfig
subPath: vpnConfigfile
- documentIndex: *DeploymentDocument
contains:
path: spec.template.spec.volumes
content:
name: vpnconfig
secret:
items:
- key: vpnConfigfile
path: vpnConfigfile
secretName: test-secret
- it: addon enabled with managed secret should pass
set:
addons:
vpn:
enabled: true
openvpn:
auth: |
<auth>
asserts:
- hasDocuments:
count: 3
- documentIndex: &SecretDocument 0
isKind:
of: Secret
- documentIndex: &DeploymentDocument 1
isKind:
of: Deployment
- documentIndex: 2
isKind:
of: Service
- documentIndex: *DeploymentDocument
not: true
equal:
path: spec.template.spec.containers[0].name
value: vpn
- it: addon enabled with custom env vars dict should pass
set:
addons:
vpn:
enabled: true
env:
int: 1
float: 1.5
string: value_of_env
template: "{{ .Release.Name }}-admin"
asserts:
- hasDocuments:
count: 2
- documentIndex: &DeploymentDocument 0
isKind:
of: Deployment
- documentIndex: &ServiceDocument 1
isKind:
of: Service
- documentIndex: *DeploymentDocument
not: true
equal:
path: spec.template.spec.containers[1].name
value: vpn
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[0]
value:
name: float
value: "1.5"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[1]
value:
name: int
value: "1"
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[2]
value:
name: string
value: value_of_env
- documentIndex: *DeploymentDocument
equal:
path: spec.template.spec.containers[1].env[3]
value:
name: template
value: RELEASE-NAME-admin