add helm charts
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
should match snapshot of default values:
|
||||
1: |
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: nginx
|
||||
kubernetes.io/tls-acme: "true"
|
||||
labels:
|
||||
app: zot
|
||||
release: RELEASE-NAME
|
||||
name: RELEASE-NAME-zot
|
||||
namespace: NAMESPACE
|
||||
spec:
|
||||
ingressClassName: nginx-test
|
||||
rules:
|
||||
- host: chart-example.local
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
name: RELEASE-NAME-zot
|
||||
port:
|
||||
number: 5000
|
||||
path: /
|
||||
pathType: ImplementationSpecific
|
||||
tls:
|
||||
- hosts:
|
||||
- chart-example.local
|
||||
secretName: chart-example-tls
|
||||
23
backing-services/zot/unittests/configmap_checksum_test.yaml
Normal file
23
backing-services/zot/unittests/configmap_checksum_test.yaml
Normal file
@@ -0,0 +1,23 @@
|
||||
suite: configmap checksum in deployment
|
||||
# Can't use global templates in this test suite as it will break the checksum calculation
|
||||
# causing false negative test outcome.
|
||||
# templates:
|
||||
# - deployment.yaml
|
||||
tests:
|
||||
- it: has no checksum/config if no config
|
||||
template: deployment.yaml
|
||||
asserts:
|
||||
- isNull:
|
||||
path: spec.template.metadata.annotations.checksum/config
|
||||
- it: generate checksum/config if config is present
|
||||
template: deployment.yaml
|
||||
set:
|
||||
mountConfig: true
|
||||
configFiles:
|
||||
config.json: "{}"
|
||||
asserts:
|
||||
- isNotNull:
|
||||
path: spec.template.metadata.annotations.checksum/config
|
||||
- matchRegex:
|
||||
path: spec.template.metadata.annotations.checksum/config
|
||||
pattern: "^[a-f0-9]{64}$" # SHA256 hex output
|
||||
47
backing-services/zot/unittests/ingress_test.yaml
Normal file
47
backing-services/zot/unittests/ingress_test.yaml
Normal file
@@ -0,0 +1,47 @@
|
||||
suite: test ingress
|
||||
templates:
|
||||
- ingress.yaml
|
||||
tests:
|
||||
- it: should be empty if ingress is not enabled
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 0
|
||||
- it: should have apiVersion networking.k8s.io/v1 for k8s >= 1.19
|
||||
set:
|
||||
ingress.enabled: true
|
||||
capabilities:
|
||||
majorVersion: 1
|
||||
minorVersion: 19
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- isKind:
|
||||
of: Ingress
|
||||
- isAPIVersion:
|
||||
of: networking.k8s.io/v1
|
||||
- it: should have an ingressClassName for k8s >= 1.19
|
||||
set:
|
||||
ingress.enabled: true
|
||||
ingress.className: nginx-test
|
||||
capabilities:
|
||||
majorVersion: 1
|
||||
minorVersion: 19
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- equal:
|
||||
path: spec.ingressClassName
|
||||
value: nginx-test
|
||||
- it: should match snapshot of default values
|
||||
set:
|
||||
ingress.enabled: true
|
||||
ingress.className: nginx-test
|
||||
ingress.annotations:
|
||||
kubernetes.io/ingress.class: nginx
|
||||
kubernetes.io/tls-acme: "true"
|
||||
ingress.tls:
|
||||
- secretName: chart-example-tls
|
||||
hosts:
|
||||
- chart-example.local
|
||||
asserts:
|
||||
- matchSnapshot: { }
|
||||
25
backing-services/zot/unittests/secret_checksum_test.yaml
Normal file
25
backing-services/zot/unittests/secret_checksum_test.yaml
Normal file
@@ -0,0 +1,25 @@
|
||||
suite: secret checksum in deployment
|
||||
# Can't use global templates in this test suite as it will break the checksum calculation
|
||||
# causing false negative test outcome.
|
||||
# templates:
|
||||
# - deployment.yaml
|
||||
tests:
|
||||
- it: has no checksum/secret if no config
|
||||
template: deployment.yaml
|
||||
asserts:
|
||||
- isNull:
|
||||
path: spec.template.metadata.annotations.checksum/secret
|
||||
- it: generate checksum/secret if config is present
|
||||
template: deployment.yaml
|
||||
set:
|
||||
mountSecret: true
|
||||
secretFiles:
|
||||
htpasswd: |-
|
||||
admin:$2y$05$vmiurPmJvHylk78HHFWuruFFVePlit9rZWGA/FbZfTEmNRneGJtha
|
||||
user:$2y$05$L86zqQDfH5y445dcMlwu6uHv.oXFgT6AiJCwpv3ehr7idc0rI3S2G
|
||||
asserts:
|
||||
- isNotNull:
|
||||
path: spec.template.metadata.annotations.checksum/secret
|
||||
- matchRegex:
|
||||
path: spec.template.metadata.annotations.checksum/secret
|
||||
pattern: "^[a-f0-9]{64}$" # SHA256 hex output
|
||||
Reference in New Issue
Block a user