chart: appVersion: 1.27.3 # renovate: datasource=docker registryUrl=https://docker.gitea.com depName=gitea release: name: gitea-unittests namespace: testing suite: ServiceAccount template templates: - templates/serviceAccount.yaml tests: - it: Render the ServiceAccount by default asserts: - hasDocuments: count: 1 - containsDocument: kind: ServiceAccount apiVersion: v1 name: gitea-unittests namespace: testing - notExists: path: metadata.annotations - equal: path: metadata.labels value: app: gitea app.kubernetes.io/instance: gitea-unittests app.kubernetes.io/managed-by: Helm app.kubernetes.io/name: gitea app.kubernetes.io/version: 1.27.3 # renovate: datasource=docker registryUrl=https://docker.gitea.com depName=gitea helm.sh/chart: gitea-0.0.0 version: 1.27.3 # renovate: datasource=docker registryUrl=https://docker.gitea.com depName=gitea - equal: path: automountServiceAccountToken value: false - notExists: path: imagePullSecrets - it: Skip rendering when serviceAccount.enabled is false set: serviceAccount: enabled: false asserts: - hasDocuments: count: 0 - it: Skip rendering when an existing ServiceAccount is used set: serviceAccount: existingServiceAccount: enabled: true existingServiceAccountName: externally-existing-serviceaccount asserts: - hasDocuments: count: 0 - it: Add custom labels when serviceAccount.new.labels is defined set: serviceAccount: new: labels: custom: label asserts: - equal: path: metadata.labels.custom value: label - it: Add custom annotations when serviceAccount.new.annotations is defined set: serviceAccount: new: annotations: myCustom: annotation asserts: - equal: path: metadata.annotations.myCustom value: annotation - it: Mount the token when serviceAccount.new.automountServiceAccountToken is true set: serviceAccount: new: automountServiceAccountToken: true asserts: - equal: path: automountServiceAccountToken value: true - it: Reference image pull secrets when serviceAccount.new.imagePullSecrets is defined set: serviceAccount: new: imagePullSecrets: - name: testing-image-pull-secret - name: another-pull-secret asserts: - contains: path: imagePullSecrets content: name: testing-image-pull-secret - contains: path: imagePullSecrets content: name: another-pull-secret