chart: appVersion: 0.1.0 version: 0.1.0 suite: Deployment template release: name: reposilite-unittest namespace: testing templates: - templates/deployment.yaml - templates/secretPrometheusBasicAuth.yaml tests: - it: Rendering default set: {} asserts: - hasDocuments: count: 1 template: templates/deployment.yaml - containsDocument: apiVersion: apps/v1 kind: Deployment name: reposilite-unittest namespace: testing template: templates/deployment.yaml - notExists: path: metadata.annotations template: templates/deployment.yaml - equal: path: metadata.labels value: app.kubernetes.io/instance: reposilite-unittest app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: reposilite app.kubernetes.io/version: 0.1.0 helm.sh/chart: reposilite-0.1.0 template: templates/deployment.yaml - equal: path: spec.replicas value: 1 template: templates/deployment.yaml - isSubset: path: spec.selector.matchLabels content: app.kubernetes.io/instance: reposilite-unittest app.kubernetes.io/name: reposilite template: templates/deployment.yaml - equal: path: spec.strategy value: type: "RollingUpdate" rollingUpdate: maxSurge: 1 maxUnavailable: 1 template: templates/deployment.yaml - notExists: path: spec.template.metadata.annotations template: templates/deployment.yaml - equal: path: spec.template.metadata.labels value: app.kubernetes.io/instance: reposilite-unittest app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: reposilite app.kubernetes.io/version: 0.1.0 helm.sh/chart: reposilite-0.1.0 template: templates/deployment.yaml - notExists: path: spec.template.spec.affinity template: templates/deployment.yaml - notExists: path: spec.template.spec.containers[0].args template: templates/deployment.yaml - notExists: path: spec.template.spec.containers[0].command template: templates/deployment.yaml - contains: path: spec.template.spec.containers[0].env content: name: JAVA_OPTS value: "-Xmx64M" template: templates/deployment.yaml - notExists: path: spec.template.spec.containers[0].envFrom template: templates/deployment.yaml - equal: path: spec.template.spec.containers[0].image value: docker.io/dzikoysk/reposilite:0.1.0 template: templates/deployment.yaml - equal: path: spec.template.spec.containers[0].imagePullPolicy value: IfNotPresent template: templates/deployment.yaml - isSubset: path: spec.template.spec.containers[0].livenessProbe content: tcpSocket: port: http failureThreshold: 3 initialDelaySeconds: 5 periodSeconds: 60 successThreshold: 1 timeoutSeconds: 3 template: templates/deployment.yaml - equal: path: spec.template.spec.containers[0].name value: reposilite template: templates/deployment.yaml - contains: path: spec.template.spec.containers[0].ports content: name: http containerPort: 8080 protocol: TCP template: templates/deployment.yaml - isSubset: path: spec.template.spec.containers[0].readinessProbe content: tcpSocket: port: http failureThreshold: 3 initialDelaySeconds: 5 periodSeconds: 15 successThreshold: 1 timeoutSeconds: 3 template: templates/deployment.yaml - notExists: path: spec.template.spec.containers[0].resources template: templates/deployment.yaml - notExists: path: spec.template.spec.containers[0].securityContext template: templates/deployment.yaml - notExists: path: spec.template.spec.containers[0].volumeMounts template: templates/deployment.yaml - notExists: path: spec.template.spec.dnsConfig template: templates/deployment.yaml - notExists: path: spec.template.spec.dnsPolicy template: templates/deployment.yaml - notExists: path: spec.template.spec.hostname template: templates/deployment.yaml - equal: path: spec.template.spec.hostNetwork value: false template: templates/deployment.yaml - notExists: path: spec.template.spec.imagePullSecrets template: templates/deployment.yaml - notExists: path: spec.template.spec.initContainers template: templates/deployment.yaml - notExists: path: spec.template.spec.nodeSelector template: templates/deployment.yaml - notExists: path: spec.template.spec.priorityClassName template: templates/deployment.yaml - notExists: path: spec.template.spec.restartPolicy template: templates/deployment.yaml - notExists: path: spec.template.spec.subdomain template: templates/deployment.yaml - equal: path: spec.template.spec.terminationGracePeriodSeconds value: 60 template: templates/deployment.yaml - notExists: path: spec.template.spec.tolerations template: templates/deployment.yaml - notExists: path: spec.template.spec.topologySpreadConstraints template: templates/deployment.yaml - notExists: path: spec.template.spec.volumes template: templates/deployment.yaml - it: Test custom replicas set: deployment.replicas: 3 asserts: - equal: path: spec.replicas value: 3 template: templates/deployment.yaml - it: Test custom strategy set: deployment.strategy: type: "RollingUpdate" rollingUpdate: maxSurge: 10 maxUnavailable: 5 asserts: - equal: path: spec.strategy value: type: "RollingUpdate" rollingUpdate: maxSurge: 10 maxUnavailable: 5 template: templates/deployment.yaml - it: Test custom affinity set: deployment.affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: topology.kubernetes.io/zone operator: In values: - antarctica-east1 - antarctica-west1 asserts: - equal: path: spec.template.spec.affinity value: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: topology.kubernetes.io/zone operator: In values: - antarctica-east1 - antarctica-west1 template: templates/deployment.yaml - it: Test additional arguments set: deployment.reposilite.args: - "--foo=bar" - "--bar=foo" asserts: - equal: path: spec.template.spec.containers[0].args value: - --foo=bar - --bar=foo template: templates/deployment.yaml - it: Test additional commands set: deployment.reposilite.command: - "/bin/bash" asserts: - equal: path: spec.template.spec.containers[0].command value: - /bin/bash template: templates/deployment.yaml - it: Test custom imageRegistry and imageRepository set: deployment.reposilite.image.registry: registry.example.local deployment.reposilite.image.repository: path/special/reposilite deployment.reposilite.image.tag: 2.0.0 asserts: - equal: path: spec.template.spec.containers[0].image value: registry.example.local/path/special/reposilite:2.0.0 template: templates/deployment.yaml - it: Test custom imagePullPolicy set: deployment.reposilite.image.pullPolicy: Always asserts: - equal: path: spec.template.spec.containers[0].imagePullPolicy value: Always template: templates/deployment.yaml - it: Test custom resources set: deployment.reposilite.resources: limits: cpu: 100m memory: 250MB requests: cpu: 25m memory: 100MB asserts: - equal: path: spec.template.spec.containers[0].resources value: limits: cpu: 100m memory: 250MB requests: cpu: 25m memory: 100MB template: templates/deployment.yaml - it: Test custom securityContext set: deployment.reposilite.securityContext: capabilities: add: - NET_RAW drop: - ALL privileged: false readOnlyRootFilesystem: true runAsNonRoot: true runAsUser: 1000 asserts: - equal: path: spec.template.spec.containers[0].securityContext value: capabilities: add: - NET_RAW drop: - ALL privileged: false readOnlyRootFilesystem: true runAsNonRoot: true runAsUser: 1000 template: templates/deployment.yaml - it: Test custom volumeMounts set: deployment.reposilite.volumeMounts: - name: data mountPath: /usr/lib/data asserts: - contains: path: spec.template.spec.containers[0].volumeMounts content: name: data mountPath: /usr/lib/data template: templates/deployment.yaml - it: Test dnsConfig set: deployment.dnsConfig: nameservers: - "8.8.8.8" - "8.8.4.4" asserts: - equal: path: spec.template.spec.dnsConfig value: nameservers: - "8.8.8.8" - "8.8.4.4" template: templates/deployment.yaml - it: Test dnsPolicy set: deployment.dnsPolicy: ClusterFirst asserts: - equal: path: spec.template.spec.dnsPolicy value: ClusterFirst template: templates/deployment.yaml - it: Test hostNetwork, hostname, subdomain set: deployment.hostNetwork: true deployment.hostname: pg-exporter deployment.subdomain: exporters.internal asserts: - equal: path: spec.template.spec.hostNetwork value: true template: templates/deployment.yaml - equal: path: spec.template.spec.hostname value: pg-exporter template: templates/deployment.yaml - equal: path: spec.template.spec.subdomain value: exporters.internal template: templates/deployment.yaml - it: Test imagePullSecrets set: deployment.imagePullSecrets: - name: my-pull-secret - name: my-special-secret asserts: - equal: path: spec.template.spec.imagePullSecrets value: - name: my-pull-secret - name: my-special-secret template: templates/deployment.yaml - it: Test initContainers set: deployment.initContainers: - name: busybox image: docker.io/library/busybox:latest asserts: - contains: path: spec.template.spec.initContainers content: name: busybox image: docker.io/library/busybox:latest template: templates/deployment.yaml - it: Test nodeSelector set: deployment.nodeSelector: foo: bar asserts: - equal: path: spec.template.spec.nodeSelector value: foo: bar template: templates/deployment.yaml - it: Test priorityClassName set: deployment.priorityClassName: my-priority asserts: - equal: path: spec.template.spec.priorityClassName value: my-priority template: templates/deployment.yaml - it: Test restartPolicy set: deployment.restartPolicy: Always asserts: - equal: path: spec.template.spec.restartPolicy value: Always template: templates/deployment.yaml - it: Test custom securityContext set: deployment.securityContext: fsGroup: 1000 runAsNonRoot: true runAsUser: 1000 runAsGroup: 1000 asserts: - equal: path: spec.template.spec.securityContext value: fsGroup: 1000 runAsNonRoot: true runAsUser: 1000 runAsGroup: 1000 template: templates/deployment.yaml - it: Test terminationGracePeriodSeconds set: deployment.terminationGracePeriodSeconds: 120 asserts: - equal: path: spec.template.spec.terminationGracePeriodSeconds value: 120 template: templates/deployment.yaml - it: Test tolerations set: deployment.tolerations: - key: hdd/type operator: Equal value: ssd effect: NoSchedule asserts: - equal: path: spec.template.spec.tolerations value: - key: hdd/type operator: Equal value: ssd effect: NoSchedule template: templates/deployment.yaml - it: Test topologySpreadConstraints set: deployment.topologySpreadConstraints: - topologyKey: kubernetes.io/hostname whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app.kubernetes.io/instance: reposilite asserts: - equal: path: spec.template.spec.topologySpreadConstraints value: - topologyKey: kubernetes.io/hostname whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app.kubernetes.io/instance: reposilite template: templates/deployment.yaml - it: Test additional volumes set: deployment.volumes: - name: data hostPath: path: /usr/lib/data asserts: - equal: path: spec.template.spec.volumes value: - name: data hostPath: path: /usr/lib/data template: templates/deployment.yaml